Skip to content

Commit

Permalink
chore(): reduce build time
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMind committed Nov 24, 2023
1 parent 347c0bf commit 7a7d416
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/usr/bin/env node

const de_lay = parseInt(process.env.CI_DELAY || 3_000, 10);
const delay = parseInt(process.env.CI_DELAY || 1_000, 10);
const shouldFail = Boolean(process.env.CI_FAIL || '');

console.log('config', {delay: de_lay, shouldFail, raw: { delay: process.env.CI_DELAY, shouldFail: process.env.CI_FAIL}});
console.log('config', {delay, shouldFail, raw: { delay: process.env.CI_DELAY, shouldFail: process.env.CI_FAIL}});

await new Promise((resolve, reject) => {
console.log(`Running build... for ${de_lay / 1000} seconds`);
console.log(`Running build... for ${delay / 1000} seconds`);
setTimeout(() => {
if (shouldFail) {
return reject('failing.... booo');
}
resolve(true);
}, de_lay);
}, delay);
});

console.log("Built!");

0 comments on commit 7a7d416

Please sign in to comment.