2024-11-18 23:57:35 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
2024-11-19 00:11:46 +00:00
|
|
|
module.exports.insideCi = function insideCi() {
|
2024-11-18 23:57:35 +00:00
|
|
|
// Bail out if this is specifically overwritten to false.
|
|
|
|
if (process.env.CI === 'false') return false
|
|
|
|
|
2024-11-19 00:11:46 +00:00
|
|
|
return !!['CI','CI_APP_ID','BUILD_NUMBER','CI_NAME','RUN_ID'].some(x => process.env[x])
|
2024-11-18 23:57:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (require.main === module) {
|
|
|
|
process.exit(insideCi() ? 0 : 1)
|
|
|
|
}
|