Skip to content

Commit

Permalink
fix(repro): improve directory prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Dec 1, 2021
1 parent 8b5c880 commit e9f9ac5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/cli/src/repro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ export const repro = async ({
type: 'text',
message: 'Enter the output directory',
name: 'directory',
initial: selectedConfig.name,
validate: (directoryName) =>
fs.existsSync(directoryName)
? `${directoryName} already exists. Please choose another name.`
: true,
});
selectedDirectory = directory;
if (fs.existsSync(selectedDirectory)) {
throw new Error(`🚨 Repro: ${selectedDirectory} already exists`);
}
}

try {
Expand Down

0 comments on commit e9f9ac5

Please sign in to comment.