Skip to content

Commit

Permalink
fix: safely fail rmSync
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Sep 19, 2022
1 parent fbd2dc7 commit 52f0012
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/generators/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ export default class Plugin extends Generator {

const directory = path.resolve(this.answers.name);
exec(`git clone https://github.com/salesforcecli/plugin-template-sf.git ${directory}`);
fs.rmSync(`${path.resolve(this.answers.name, '.git')}`, { recursive: true });
try {
fs.rmSync(`${path.resolve(this.answers.name, '.git')}`, { recursive: true });
} catch {
// ignore
}

this.destinationRoot(directory);
this.env.cwd = this.destinationPath();
}
Expand Down

0 comments on commit 52f0012

Please sign in to comment.