Skip to content

Commit

Permalink
Merge pull request #31 from Dahlgren/bugfix/zsyncmake-characters
Browse files Browse the repository at this point in the history
fix: zsyncmake crashing when filename contains $
  • Loading branch information
Fusselwurm authored Oct 18, 2024
2 parents 6cf2be0 + 3aea645 commit 9039117
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/service/zsync/zsyncmake.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
})
});
2 changes: 1 addition & 1 deletion src/service/zsync/zsyncmake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
Expand Down

0 comments on commit 9039117

Please sign in to comment.