mirror of
https://github.com/strapi/strapi.git
synced 2025-08-11 18:27:22 +00:00
Add exception for Yarn to copy/paste the .gitignore file in each plugin
This commit is contained in:
parent
565cfda087
commit
c4763d173f
@ -77,7 +77,11 @@ module.exports = function (plugin, cliArguments) {
|
|||||||
fs.accessSync(path.join(pluginPath, '.gitignore'))
|
fs.accessSync(path.join(pluginPath, '.gitignore'))
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code === 'ENOENT') {
|
if (err.code === 'ENOENT') {
|
||||||
fs.copySync(path.resolve(__dirname, '..', 'node_modules', 'strapi-generate-plugin', 'templates', 'gitignore'), path.join(pluginPath, '.gitignore'));
|
if (process.mainModule.filename.indexOf('yarn') !== -1) {
|
||||||
|
fs.copySync(path.resolve(__dirname, '..', '..', 'strapi-generate-plugin', 'templates', 'gitignore'), path.join(pluginPath, '.gitignore'));
|
||||||
|
} else {
|
||||||
|
fs.copySync(path.resolve(__dirname, '..', 'node_modules', 'strapi-generate-plugin', 'templates', 'gitignore'), path.join(pluginPath, '.gitignore'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user