I am writing a Yeoman generator and I want to copy a directory. You can find the code below. However, it works correctly, however, after the copy is complete, I want to perform additional actions, such as "npm install". Since copying is performed asynchronously, "npm install" is performed before all files have been copied. How can I wait for all copy actions to complete?
this.expandFiles('**', {
cwd: this.sourceRoot(),
dot: true
}).forEach(function (el) {
this.copy(el, el);
}, this);
source
share