Skip to content

Commit

Permalink
Fix cli prompting to select individual files even after all is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
lorefnon committed Jul 2, 2023
1 parent 3a64321 commit 08e6af2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/file-remover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export class FileRemover {
let pathsToDelete: string[] = []
if (this.opts.removeExtraneous === 'all') {
pathsToDelete = extraneousPaths
}
else if (this.opts.removeExtraneous === 'interactively') {
} else if (this.opts.removeExtraneous === 'interactively') {
const { selection } = await prompts({
type: 'select',
name: 'selection',
Expand All @@ -40,6 +39,7 @@ export class FileRemover {
switch (selection) {
case '$all': {
pathsToDelete = extraneousPaths
break;
}
case '$pick': {
const { candidates } = await prompts({
Expand All @@ -50,6 +50,7 @@ export class FileRemover {
hint: '- Space to select. Return to submit'
})
pathsToDelete.push(...candidates)
break;
}
}
}
Expand Down

0 comments on commit 08e6af2

Please sign in to comment.