Skip to content

Commit

Permalink
Escape single quote in path
Browse files Browse the repository at this point in the history
  • Loading branch information
JL03-Yue committed Sep 12, 2023
1 parent efcba6b commit 9e26f7c
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ export class AcquisitionInvoker extends IAcquisitionInvoker {
private escapeFilePath(path: string): string {
if (os.platform() === 'win32') {
// Need to escape apostrophes with two apostrophes
const dotnetInstallDirEscaped = path.replace(/'/g, `''`);

const dotnetInstallDirEscaped = path.replace(/'/g, `\'`);
// Surround with single quotes instead of double quotes (see https://github.com/dotnet/cli/issues/11521)
return `'${dotnetInstallDirEscaped}'`;
} else {
Expand Down

0 comments on commit 9e26f7c

Please sign in to comment.