Skip to content

Commit

Permalink
Update theme-upload.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nahbee10 authored Dec 18, 2024
1 parent 283c6d8 commit ca368ef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bin/theme-upload.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/* eslint-env node */
const brandId = process.env.BRAND_ID;
const { execSync } = require("child_process");
const { execSync } = require('child_process');

function zcli(command) {
const data = execSync(`yarn --silent zcli ${command} --json`);
return JSON.parse(data.toString());
}

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

zcli(`themes:publish --themeId=${themeId}`);

const { themes } = zcli(`themes:list --brandId=${brandId}`);
const { themes } = zcli(`themes:list`);

for (const { live, id } of themes) {
if (!live) zcli(`themes:delete --themeId=${id}`);
for (const { live, id, name } of themes) {
if (!live && name === "[Don't edit code] Copenhagen Sanctuary Production")
zcli(`themes:delete --themeId=${id}`);
}

0 comments on commit ca368ef

Please sign in to comment.