diff --git a/libs/msc-flash/msc-flash-harmony/src/lib/services/unpack-flashing-image.ts b/libs/msc-flash/msc-flash-harmony/src/lib/services/unpack-flashing-image.ts index 75f6e9a5a1..2cba1c2e47 100644 --- a/libs/msc-flash/msc-flash-harmony/src/lib/services/unpack-flashing-image.ts +++ b/libs/msc-flash/msc-flash-harmony/src/lib/services/unpack-flashing-image.ts @@ -19,8 +19,10 @@ export const unpackFlashingImageService = async ( command = `tar -xf "${imageFilePath}" -C "${osDownloadLocation}"` } if (process.platform === "win32") { - const imageFilePath = path.join(osDownloadLocation, fileName) - command = `tar -xzvf "${imageFilePath}" -C "${osDownloadLocation}"` + const imageFilePathTarGz = path.join(osDownloadLocation, fileName) + const baseName = path.basename(fileName, ".tar.gz"); + const imageFilePathTar = path.join(osDownloadLocation, `${baseName}.tar`, `${baseName}.tar`) + command = `tar -xzvf "${imageFilePathTarGz}" -C "${osDownloadLocation}" && tar -xvf "${imageFilePathTar}" -C "${osDownloadLocation}" ` } try { diff --git a/libs/shared/utils/src/lib/exec-command-with-sudo.ts b/libs/shared/utils/src/lib/exec-command-with-sudo.ts index 00bf4538d8..d61e17b1b9 100644 --- a/libs/shared/utils/src/lib/exec-command-with-sudo.ts +++ b/libs/shared/utils/src/lib/exec-command-with-sudo.ts @@ -7,7 +7,7 @@ import sudoPrompt from "@vscode/sudo-prompt" export const execCommandWithSudo = ( command: string, - options?: { name?: string; icns?: string; env?: { [key: string]: string } } + options: { name?: string; icns?: string; env?: { [key: string]: string } } = {} ): Promise => { return new Promise((resolve, reject) => { sudoPrompt.exec(command, options, (error, stdout, stderr) => {