fix: make build work with npm

This commit is contained in:
Christian Köberl
2022-02-09 20:56:48 +01:00
committed by Bastian
parent fcdbb403e6
commit 39618b7e9e
2 changed files with 4 additions and 4 deletions

View File

@@ -57,10 +57,10 @@ var runCommand = function (command) {
}); });
}; };
var buildTemplate = function () { var buildTemplate = function () {
var packageManager = fs.existsSync(paths.appYarnLock) ? "yarn" : "npx"; var packageManager = fs.existsSync(paths.appYarnLock) ? "yarn" : "npm";
fs.emptyDirSync(paths.templateBuild); fs.emptyDirSync(paths.templateBuild);
process.chdir(paths.template); process.chdir(paths.template);
return runCommand(packageManager + " build"); return runCommand(packageManager + " run build");
}; };
buildTemplate().then(function () { buildTemplate().then(function () {
fs.copySync(paths.templateBuild, paths.appBuild); fs.copySync(paths.templateBuild, paths.appBuild);

View File

@@ -42,12 +42,12 @@ const runCommand = (command: string) =>
}); });
const buildTemplate = () => { const buildTemplate = () => {
const packageManager = fs.existsSync(paths.appYarnLock) ? "yarn" : "npx"; const packageManager = fs.existsSync(paths.appYarnLock) ? "yarn" : "npm";
fs.emptyDirSync(paths.templateBuild); fs.emptyDirSync(paths.templateBuild);
process.chdir(paths.template); process.chdir(paths.template);
return runCommand(`${packageManager} build`); return runCommand(`${packageManager} run build`);
}; };
buildTemplate().then(() => { buildTemplate().then(() => {