Created
October 16, 2023 06:59
-
-
Save aztack/4ddcfb9b400e94eac7dbe7f243f85b96 to your computer and use it in GitHub Desktop.
Yeoman Generator Overwrite without Prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class extends Generator { | |
writing() { | |
// enable force overwrite | |
this.conflicter.force = true; | |
this.fs.copyTpl( | |
this.templatePath('_package.json'), | |
this.destinationPath('package.json'), | |
{ appname: 'your_appname' } | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment