exit if nothing is selected

This commit is contained in:
cupcakearmy 2020-12-29 21:35:49 +01:00
parent 5fe4d2b195
commit ef48dd9033
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9

View File

@ -50,6 +50,10 @@ async function main() {
])
loosers = getLoosers(keepers, leaves)
if (loosers.length === 0) {
console.log(chalk.bold('No package/s selected for deletion.'))
return
}
const { confirmed } = await inquirer.prompt([
{
type: 'confirm',
@ -78,4 +82,6 @@ async function main() {
console.log(chalk.bold.green('🚀 Done'))
}
main()
main().finally(() => {
console.log(chalk.blue('Bye Bye 👋'))
})