From 3aea6450ba09e6e82484d336a9d8d3f72c3cebd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Dahlgren?= Date: Fri, 18 Oct 2024 19:38:14 +0200 Subject: [PATCH] fix: zsyncmake crashing when filename contains $ --- src/service/zsync/zsyncmake.spec.ts | 2 +- src/service/zsync/zsyncmake.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/service/zsync/zsyncmake.spec.ts b/src/service/zsync/zsyncmake.spec.ts index f9aad03..1c824b6 100644 --- a/src/service/zsync/zsyncmake.spec.ts +++ b/src/service/zsync/zsyncmake.spec.ts @@ -12,7 +12,7 @@ describe(zsyncmake.name, () => { await zsyncmakeWithExec('/needs-update', (cmd, callback) => {cmdLine = cmd; callback(null, {stdout: '', stderr: ''});}); - expect(cmdLine).toBe('zsyncmake -eu "http://foo/needs-update" -o "/var/lib/repo/needs-update.zsync" "/var/lib/repo/needs-update"'); + expect(cmdLine).toBe("zsyncmake -eu 'http://foo/needs-update' -o '/var/lib/repo/needs-update.zsync' '/var/lib/repo/needs-update'"); done(); }) }); diff --git a/src/service/zsync/zsyncmake.ts b/src/service/zsync/zsyncmake.ts index 6ae1143..fce3e99 100644 --- a/src/service/zsync/zsyncmake.ts +++ b/src/service/zsync/zsyncmake.ts @@ -16,7 +16,7 @@ function checkPath(file: Path) { } function getCmdLine(publicURL: string, rootPath: Path, file: Path): string { - return `zsyncmake -eu "${publicURL}${file}" -o "${rootPath}${file}.zsync" "${rootPath}${file}"`; + return `zsyncmake -eu '${publicURL}${file}' -o '${rootPath}${file}.zsync' '${rootPath}${file}'`; } export async function zsyncmake(file: Path): Promise {