@zohodesk/platform-middleware
Version:
Generalized Contract for the events from Marketplace App, In-App widgets, CRM-Plus and EFC
29 lines (20 loc) • 850 B
JavaScript
const { spawnSync } = require("child_process");
const path = require("path");
const fs = require("fs");
let print = console;
let log = (...args) => {
print.log(...args);
};
let tempDir = path.join(__dirname, "temp");
let zappsFramework = `${"ht"}${"tp"}://build/zoho/zapp_framework/milestones/beta_release/ZAPP_FRAMEWORK_APR_10/ZAPP_DESK.zip`;
spawnSync("rm", ["-rf", tempDir]);
fs.mkdirSync(tempDir);
log("Temp directory created for SigmaFiles");
spawnSync("wget", [zappsFramework], { cwd: tempDir });
log("SigmaFiels download completed");
spawnSync("unzip", ["-o", "ZAPP_DESK.zip"], { cwd: tempDir });
log("Extracting the SigmaFiles from ZAPP_DESK.zip");
spawnSync("mv", ["ZFramework.js", "../../src/sigmafiles/"], { cwd: tempDir });
log("SigmaFiles Movement Completed");
spawnSync("rm", ["-rf", tempDir]);
log("Temp directory removed");