Skip to content

Commit 17c4932

Browse files
committed
fix(cli): printed args now also display path used during directory prompt
1 parent 4c4e66d commit 17c4932

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/kind-bananas-joke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'sv': patch
3+
---
4+
5+
fix(cli): printed args now also display path used during directory prompt

packages/cli/commands/create.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ const OptionsSchema = v.strictObject({
6969
});
7070
type Options = v.InferOutput<typeof OptionsSchema>;
7171
type ProjectPath = v.InferOutput<typeof ProjectPathSchema>;
72-
const defaultPath = './';
7372

7473
export const create = new Command('create')
7574
.description('scaffolds a new SvelteKit project')
@@ -147,8 +146,9 @@ async function createProject(cwd: ProjectPath, options: Options) {
147146
const { directory, template, language } = await p.group(
148147
{
149148
directory: () => {
149+
const defaultPath = './';
150150
if (cwd) {
151-
return Promise.resolve(path.resolve(cwd));
151+
return Promise.resolve(cwd);
152152
}
153153
return p.text({
154154
message: 'Where would you like your project to be created?',
@@ -307,7 +307,7 @@ async function createProject(cwd: ProjectPath, options: Options) {
307307

308308
if (argsFormattedAddons.length > 0) argsFormatted.push('--add', ...argsFormattedAddons);
309309

310-
common.logArgs(packageManager, 'create', argsFormatted, [cwd ?? defaultPath]);
310+
common.logArgs(packageManager, 'create', argsFormatted, [directory]);
311311

312312
await addPnpmBuildDependencies(projectPath, packageManager, ['esbuild']);
313313
if (packageManager) await installDependencies(packageManager, projectPath);

0 commit comments

Comments
 (0)