unify bin scriptnames

This commit is contained in:
dennis.ludwig
2021-06-11 22:24:50 +02:00
parent e2aec44ad7
commit 5c581de249
5 changed files with 34 additions and 21 deletions

View File

@@ -15,11 +15,11 @@ process.on("unhandledRejection", (err) => {
const fs = require("fs-extra");
const paths = require("../config/paths");
const childProcess = require("child_process");
const runCommand = (command, args) => {
const cp = require("child_process");
return new Promise((resolve, reject) => {
const executedCommand = cp.spawn(command, args, {
const executedCommand = childProcess.spawn(command, args, {
stdio: "inherit",
shell: true,
});
@@ -43,15 +43,13 @@ const buildTemplate = () => {
fs.emptyDirSync(paths.templateBuild);
process.chdir(paths.template);
return runCommand(`${packageManager} build`).catch((error) => {
console.error(error);
process.exit(1);
});
};
// TODO: Use other output folder than bin for compiled tasks, because bin is misleading with node bin folder
// TODO: add dist folder for precompiled builder
if (fs.existsSync(paths.appRdJson)) {
buildTemplate().then(() => {
fs.copySync(paths.templateBuild, paths.appBuild);

View File

@@ -13,10 +13,12 @@ process.on("unhandledRejection", (err) => {
throw err;
});
const paths = require("../config/paths");
require("../bin/tasks/radarjson")
.radarJsonGenerator()
.then(() => {
console.log("rd.json created");
console.log(`${paths.appRdJson} created.`);
})
.catch((err) => {
if (err && err.message) {