-
-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove files with this.fs.delete #1505
Comments
Try this: removeDir : function() {
this.fs.delete('grunt/**/*.js');
} |
What do you mean? |
Thanks, @kevva. It looks when the function executes in the default priority (#2), the files aren't been copied over yet, so no files are removed. However, when I move the removeDir function to the end priority (#1), it works fine. Is there a way to force the execution of a function within the default priority after another function has been executed? so when the files have been already copied. //#1 function as part of end priority - works as expected
module.exports = yeoman.generators.Base.extend({
//...default priority
grunt: function() {
this.bulkDirectory('grunt', 'grunt');
},
end : { // end priority
removeDir: function () {
this.fs.delete('grunt/**/apigee-config.js');
}
}
}); //#2 function as part of default priority - it doesn't remove files
module.exports = yeoman.generators.Base.extend({
grunt: function() {
this.bulkDirectory('grunt', 'grunt');
},
removeDir: function () {
this.fs.delete('grunt/**/apigee-config.js');
}
}); |
@kevva and @SBoudrias I think somewhere along the lines of managing Yeoman Grunfile should help me to figure this out. However, The one on the page doesn't provide an end-to-end example. |
No, when composing, your generators should be context agnostic. They should be standalone and not depends on each other. If you don't want to generate these files, instead of deleting them after creation, pass an option to the sub-generator to not generate them. |
Hi there, I'm trying to remove files from a folder. However, nothing happens. Files are never removed. They can be removed though, if they exist under root folder. Am I missing anything?
The text was updated successfully, but these errors were encountered: