Skip to content

Commit e1aa339

Browse files
committed
bit better
1 parent b6ecec8 commit e1aa339

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/cli/lib/testing.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'node:fs';
22
import path from 'node:path';
33
import process from 'node:process';
44
import degit from 'degit';
5-
import { exec } from 'tinyexec';
5+
import { x, exec } from 'tinyexec';
66
import { create } from '@sveltejs/create';
77

88
export { addPnpmBuildDependencies } from '../utils/package-manager.ts';
@@ -83,7 +83,7 @@ export function createProject({ cwd, testName, templatesDir }: CreateOptions): C
8383
type PreviewOptions = { cwd: string; command?: string };
8484
export async function startPreview({
8585
cwd,
86-
command = 'npm run preview'
86+
command = 'pnpm preview'
8787
}: PreviewOptions): Promise<{ url: string; close: () => Promise<void> }> {
8888
const [cmd, ...args] = command.split(' ');
8989
const proc = exec(cmd, args, {
@@ -124,7 +124,7 @@ export async function startPreview({
124124
async function terminate(pid: number) {
125125
try {
126126
if (process.platform === 'win32') {
127-
await exec(`taskkill /pid ${pid} /T /F`); // on windows, use taskkill to terminate the process tree
127+
await x('taskkill', ['/PID', `${pid}`, '/T', '/F']); // on windows, use taskkill to terminate the process tree
128128
} else {
129129
process.kill(-pid, 'SIGTERM'); // Kill the process group
130130
}

0 commit comments

Comments
 (0)