Skip to content

Commit 7af6fb8

Browse files
committed
Ensure Windows builds work if the username contains spaces
Without this, we hit issues where the path to the server contains spaces, and that means this fails to run successfully. With this change, the paths on Windows are quoted, which avoids that issue.
1 parent c2b8ae8 commit 7af6fb8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ function showNotification(title: string, body: string) {
173173
async function startServer(retries = 2) {
174174
const binName = isWindows ? 'httptoolkit-server.cmd' : 'httptoolkit-server';
175175
const serverBinPath = path.join(__dirname, '..', 'httptoolkit-server', 'bin', binName);
176+
const serverBinCommand = isWindows ? `"${serverBinPath}"` : serverBinPath;
176177

177-
server = spawn(serverBinPath, ['start'], {
178+
server = spawn(serverBinCommand, ['start'], {
178179
windowsHide: true,
179180
stdio: ['inherit', 'pipe', 'pipe'],
180181
shell: isWindows, // Required to spawn a .cmd script

0 commit comments

Comments
 (0)