Skip to content

Commit

Permalink
[CP-3184] Unpacking method fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarski committed Oct 16, 2024
1 parent c0869f4 commit 26e21f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/utils/src/lib/exec-command-with-sudo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string | void> => {
return new Promise((resolve, reject) => {
sudoPrompt.exec(command, options, (error, stdout, stderr) => {
Expand Down

0 comments on commit 26e21f1

Please sign in to comment.