forked from baron/baron-sso
네이버 웍스 연동기능 개선
This commit is contained in:
29
orgfront/scripts/build-org-context-chart.mjs
Normal file
29
orgfront/scripts/build-org-context-chart.mjs
Normal file
@@ -0,0 +1,29 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
|
||||
const buildId = createBuildId();
|
||||
const npmCommand = process.platform === "win32" ? "npm.cmd" : "npm";
|
||||
const env = {
|
||||
...process.env,
|
||||
ORG_CONTEXT_CHART_BUILD_ID: buildId,
|
||||
};
|
||||
|
||||
for (const script of [
|
||||
"build:org-context-chart:full",
|
||||
"build:org-context-chart:min",
|
||||
]) {
|
||||
const result = spawnSync(npmCommand, ["run", script], {
|
||||
env,
|
||||
stdio: "inherit",
|
||||
});
|
||||
if (result.status !== 0) {
|
||||
process.exit(result.status ?? 1);
|
||||
}
|
||||
}
|
||||
|
||||
function createBuildId() {
|
||||
const now = new Date();
|
||||
const year = String(now.getFullYear()).slice(-2);
|
||||
const month = String(now.getMonth() + 1).padStart(2, "0");
|
||||
const random = String(Math.floor(Math.random() * 10000)).padStart(4, "0");
|
||||
return `${year}${month}${random}`;
|
||||
}
|
||||
Reference in New Issue
Block a user