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,9 +77,13 @@ module.exports = function (plugin, cliArguments) {
|
||||
fs.accessSync(path.join(pluginPath, '.gitignore'))
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
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'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Success.
|
||||
logger.info('The plugin has been successfully installed.');
|
||||
|
Loading…
x
Reference in New Issue
Block a user