Skip to content

Commit 2dc45f8

Browse files
authored
Merge pull request #69 from saucelabs/DEVX-2680-error-handling
refactor: No error catch in zip method
2 parents ec0007c + e8a6ec6 commit 2dc45f8

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/zip.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function getCommand(source: string, dest: string): string {
8989
case 'darwin':
9090
return `zip -ryq "${dest}" "${source}"`;
9191
case 'win32':
92-
return `Compress-Archive -Path ${source} -DestinationPath ${dest} -Force`;
92+
return `powershell -Command "Compress-Archive -Path ${source} -DestinationPath ${dest} -Force"`;
9393
default:
9494
throw new Error(`Unsupported operating system: ${osPlatform}`);
9595
}
@@ -103,12 +103,6 @@ function getCommand(source: string, dest: string): string {
103103
* @param dest The path where the output zip file should be saved.
104104
*/
105105
export function zip(workspace: string, source: string, dest: string) {
106-
try {
107-
validate(workspace, source, dest);
108-
execSync(getCommand(source, dest));
109-
} catch (error) {
110-
console.error(
111-
`Zip file creation failed for destination: "${dest}", source: "${source}". Error: ${error}.`,
112-
);
113-
}
106+
validate(workspace, source, dest);
107+
execSync(getCommand(source, dest));
114108
}

0 commit comments

Comments
 (0)