简体   繁体   中英

In Yeoman, how can I move a folder and force delete on the original location?

I am trying to move a folder in Yeoman without asking the user to approve every single file in the move. I currently have the two following ways to do this, but Yeoman's documentation is horrible and I can not figure out if there is a parameter to force delete.

//First way
this.fs.move(sourceDir, destDir);

//Second way
this.directory(sourceDir, destDir);
this.fs.delete(sourceDir);

Both of these ways will copy the folder + contents just fine, but the old folder remains or it will ask me to approve every removed file. I need it to just force delete somehow.

Yeoman doesn't allow you to move pre-exisintg files around without asking user confirmation. User trusts Yeoman to not mess up their applications in unexpected way, so that's why it'll ask confirmation.

Users can always select accept all changes or run with yo generator --force to skip validation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM