Skip to content

Commit

Permalink
use rm instead rmdir
Browse files Browse the repository at this point in the history
Since node v16, rmdir changed their behaviour when the path is not a valid
directory.
  • Loading branch information
ccarruitero committed May 30, 2021
1 parent 0d1a928 commit 9667c5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const buildExt = async ({
permissions
}) => {
const projectPath = path.resolve(process.cwd(), name);
await fsp.rmdir(projectPath, { recursive: true });
await fsp.rm(projectPath, { recursive: true, force: true });
await fsp.mkdir(projectPath);
await copyTpl('package.json', projectPath, { name });
await copyTpl('README.md', projectPath, { name, description });
Expand Down

0 comments on commit 9667c5d

Please sign in to comment.