Skip to content

Commit d5d5206

Browse files
iwoplazaCopilot
andcommitted
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 9e4daca commit d5d5206

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

packages/typegpu-cli/src/create.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,22 @@ export async function createProject(cwd: string) {
5757
const installCmd = resolveCommand(pm, 'install', []);
5858
const runCmd = resolveCommand(pm, 'run', ['dev']);
5959

60-
let msg = 'Done!\n';
61-
msg += ` To get started run:\n\n`;
60+
const steps: string[] = [];
61+
const shouldCd = (!shouldInstall && !!installCmd) || !!runCmd || !!cdPath;
62+
if (shouldCd && cdPath) {
63+
steps.push(` cd ${cdPath}`);
64+
}
6265
if (!shouldInstall && installCmd) {
63-
msg += ` cd ${cdPath}\n`;
64-
msg += ` ${installCmd.command} ${installCmd.args.join(' ')}\n`;
65-
} else if (cdPath) {
66-
msg += ` cd ${cdPath}\n`;
66+
steps.push(` ${installCmd.command} ${installCmd.args.join(' ')}`);
6767
}
6868
if (runCmd) {
69-
msg += ` ${runCmd.command} ${runCmd.args.join(' ')}`;
69+
steps.push(` ${runCmd.command} ${runCmd.args.join(' ')}`);
70+
}
71+
72+
let msg = 'Done!\n';
73+
if (steps.length > 0) {
74+
msg += ` To get started run:\n\n`;
75+
msg += steps.join('\n');
7076
}
7177

7278
p.outro(msg);

packages/typegpu-cli/src/utils/pm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function pmInstall(pm: Agent) {
5858
failAndExit(`Cannot resolve install command for ${pm}`);
5959
}
6060

61-
const label = `${cmd.command} ${cmd.args.join(' ')}`;
61+
const label = `${cmd.command}${cmd.args.length ? ` ${cmd.args.join(' ')}` : ''}`;
6262
p.log.step(`Running ${label}...`);
6363
runCommand(cmd.command, cmd.args, true);
6464
p.log.success('Installed dependencies.');

0 commit comments

Comments
 (0)