Skip to content

Commit 2a0a53e

Browse files
authored
fix(init): Trim whitespace (#31)
1 parent d480538 commit 2a0a53e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/init.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async function prompt<T>(
5252
options: Parameters<typeof consola.prompt>[1],
5353
previousValue?: any,
5454
): Promise<T> {
55-
const result = await consola.prompt(message, {
55+
let result = await consola.prompt(message, {
5656
default: previousValue,
5757
placeholder: previousValue,
5858
...options,
@@ -61,6 +61,9 @@ async function prompt<T>(
6161
if (typeof result === 'symbol') {
6262
throw Error('Canceled');
6363
}
64+
if (typeof result === 'string') {
65+
result = result.trim();
66+
}
6467
return result as T;
6568
}
6669

0 commit comments

Comments
 (0)