Files
copenlight/bin/theme-upload.js
Ivan Carlos de Almeida 6fa41a771d
Some checks failed
Build, Push, Publish / Build & Release (push) Failing after 2s
Sync Repo / sync (push) Failing after 2s
first load
2025-12-16 04:40:00 -03:00

26 lines
673 B
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-env node */
const brandId = process.env.BRAND_ID;
const { execSync } = require("child_process");
function zcli(command) {
try {
const data = execSync(`yarn zcli ${command} --json`);
return JSON.parse(data.toString());
} catch (e) {
console.error(e.message);
console.error(e.stdout.toString());
process.exit(1);
}
}
const { themeId } = zcli(`themes:import --brandId=${brandId}`);
zcli(`themes:publish --themeId=${themeId}`);
const { themes } = zcli(`themes:list --brandId=${brandId}`);
for (const { live, id } of themes) {
if (!live) zcli(`themes:delete --themeId=${id}`);
}