Skip to content

Commit

Permalink
fix: escape command with quotes only for Windows
Browse files Browse the repository at this point in the history
follow up of #1270
For example for brew command it's failing on macOS

Change-Id: I92b7bf8b9b7a50282cbd668bdaea6c1fee930885
Signed-off-by: Florent Benoit <[email protected]>
  • Loading branch information
benoitf committed Feb 15, 2023
1 parent f1dbc79 commit 8f56284
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extensions/podman/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ export function runCliCommand(command: string, args: string[], options?: RunOpti
// In production mode, applications don't have access to the 'user' path like brew
if (isMac || isWindows) {
env.PATH = getInstallationPath();
// Escape any whitespaces in command
command = `"${command}"`;
if (isWindows) {
// Escape any whitespaces in command
command = `"${command}"`;
}
} else if (env.FLATPAK_ID) {
// need to execute the command on the host
args = ['--host', command, ...args];
Expand Down

0 comments on commit 8f56284

Please sign in to comment.