docbrown/docs/deploy-script.js
Andy Zhao f5e61fdae2 Update Docs deploy command (#3940)
Use make build instead of only gitdocs command
2019-09-04 09:29:49 -04:00

26 lines
568 B
JavaScript

const exec = require('child_process').exec;
const subdomain = process.env.URL;
let buildCommand;
switch (subdomain) {
case 'docs':
buildCommand = 'make';
break;
case 'storybook':
buildCommand = 'cd .. && npm install && npm run build-storybook';
break;
default:
throw `Domain ${subdomain} is invalid`;
}
async function execute(command) {
return await exec(command, function(error, stdout, stderr) {
if (error) {
throw error;
}
console.log(`domain: ${subdomain}`);
console.log(stdout);
});
}
execute(buildCommand);