Skip to content

Commit a0238d1

Browse files
committed
fix: trim targetDir
1 parent a7dd2ba commit a0238d1

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

index.ts

+9-11
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,15 @@ async function init() {
242242
)
243243

244244
if (!targetDir) {
245-
targetDir =
246-
result.projectName =
247-
result.packageName =
248-
await unwrapPrompt(
249-
text({
250-
message: language.projectName.message,
251-
placeholder: defaultProjectName,
252-
validate: (value) =>
253-
value.trim().length > 0 ? undefined : language.projectName.invalidMessage,
254-
}),
255-
)
245+
const _result = await unwrapPrompt(
246+
text({
247+
message: language.projectName.message,
248+
placeholder: defaultProjectName,
249+
validate: (value) =>
250+
value.trim().length > 0 ? undefined : language.projectName.invalidMessage,
251+
}),
252+
)
253+
targetDir = result.projectName = result.packageName = _result.trim()
256254
}
257255

258256
if (!canSkipEmptying(targetDir) && !forceOverwrite) {

0 commit comments

Comments
 (0)