Skip to content
Snippets Groups Projects
Commit d2b19ac6 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier
Browse files

cicd: exit code

parent ccc9d24d
No related branches found
Tags v5.2.3
No related merge requests found
Pipeline #10412 passed
......@@ -25,9 +25,9 @@ const options = {
autoInstall: true
};
(async function() {
((async function () {
let configPath = process.env.CONFIG_PATH || 'config.json';
if(!fs.existsSync(configPath)) throw `[Error] (Mandatory) Missing ${configPath} file`;
if (!fs.existsSync(configPath)) throw console.error(Error(`(Mandatory) Missing ${configPath} file`));
console.log(`Using ${configPath} config file`);
let config = JSON.parse(fs.readFileSync(configPath));
......@@ -68,9 +68,11 @@ const options = {
const bundler = new Bundler('./src/index.pug', options);
bundler.addAssetType('html', require.resolve('./assets.js'));
if(process.env.NODE_ENV !== 'production') {
if (process.env.NODE_ENV !== 'production') {
await bundler.serve();
} else {
await bundler.bundle();
}
})();
\ No newline at end of file
})()).catch((e) => {
process.exitCode = 1;
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment