Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"access": "public"
},
"dependencies": {
"@clack/prompts": "^0.11.0",
"@clack/prompts": "^1.7.0",
"commander": "^14.0.0",
"kleur": "^4.1.5",
"tsup": "^8.3.5"
Expand Down
15 changes: 9 additions & 6 deletions src/cli/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export const createModule = async (
inactive: 'no',
})
if (p.isCancel(confirm)) {
p.cancel('Cancelled')
process.exit(1)
} else if (confirm) {
rmSync(resolvedTargetModulePath, {
Expand All @@ -283,7 +284,7 @@ export const createModule = async (
})
shouldCleanupModulePath = true
} else {
console.log(kleur.red('Cancelled'))
p.cancel('Cancelled')
process.exit(1)
}
} else {
Expand Down Expand Up @@ -425,7 +426,10 @@ const getUserAnswers = async (
defaultValue: name,
initialValue: name,
validate(value) {
const packageName = value?.trim()
if (value === undefined) {
return validatePackageName('')
}
const packageName = value.trim()
return validatePackageName(packageName)
},
})
Expand Down Expand Up @@ -518,6 +522,7 @@ const getUserAnswers = async (
),
})
if (p.isCancel(confirm)) {
p.cancel('Cancelled')
process.exit(0)
} else if (confirm) {
return usedPm
Expand Down Expand Up @@ -575,17 +580,15 @@ const getUserAnswers = async (
),
})
if (!packageNameConfirmation) {
console.log(
kleur.red('Package name confirmation cancelled')
)
p.cancel('Package name confirmation cancelled')
process.exit(1)
}
return packageNameConfirmation
},
},
{
onCancel() {
console.log(kleur.red('Cancelled'))
p.cancel('Cancelled')
process.exit(1)
},
}
Expand Down
Loading