-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstallation.js
More file actions
31 lines (28 loc) · 1.09 KB
/
installation.js
File metadata and controls
31 lines (28 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const fs = require("fs");
const { exec } = require('child_process');
process.env = require('dotenv').config().parsed;
// Generate build for installation
function generateInstallationBuild() {
const vueProjectDirectory = __dirname + '/installation';
if (fs.existsSync(vueProjectDirectory)) {
console.log("Start Generate Build in Installation");
let buildCommand = "npm run build";
if (process.platform === "linux") {
buildCommand = 'PATH=$(which vue) && $PATH build';
}
// Change the current working directory to the Vue project directory
process.chdir(vueProjectDirectory);
// Generate production build
exec(buildCommand, (buildError, buildStdout, buildStderr) => {
if (buildError) {
console.log(`Error Generate Build in Installation: ${buildError}`);
return;
}
console.log("End Generate Build in Installation");
console.log("All Steps is Done");
});
} else {
console.log("All Steps is Done");
}
};
generateInstallationBuild();