Skip to content

Commit 20851ea

Browse files
committed
chore: added error handling to the theme-upload script
1 parent b679912 commit 20851ea

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bin/theme-upload.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ const brandId = process.env.BRAND_ID;
44
const { execSync } = require("child_process");
55

66
function zcli(command) {
7-
const data = execSync(`yarn zcli ${command} --json`);
8-
return JSON.parse(data.toString());
7+
try {
8+
const data = execSync(`yarn zcli ${command} --json`);
9+
return JSON.parse(data.toString());
10+
} catch (e) {
11+
console.error(e.message);
12+
console.error(e.stdout.toString());
13+
process.exit(1);
14+
}
915
}
1016

1117
const { themeId } = zcli(`themes:import --brandId=${brandId}`);

0 commit comments

Comments
 (0)