@oclif/multi-stage-output
Advanced tools
Comparing version 0.5.3 to 0.5.4-qa.0
@@ -10,6 +10,28 @@ import { ux } from '@oclif/core/ux'; | ||
import { readableTime } from './utils.js'; | ||
// Taken from https://github.com/sindresorhus/is-in-ci | ||
const isInCi = env.CI !== '0' && | ||
env.CI !== 'false' && | ||
('CI' in env || 'CONTINUOUS_INTEGRATION' in env || Object.keys(env).some((key) => key.startsWith('CI_'))); | ||
function isTruthy(value) { | ||
return value !== '0' && value !== 'false'; | ||
} | ||
/** | ||
* Determines whether the CI mode should be used. | ||
* | ||
* If the MSO_DISABLE_CI_MODE environment variable is set to a truthy value, CI mode will be disabled. | ||
* | ||
* If the CI environment variable is set, CI mode will be enabled. | ||
* | ||
* If the DEBUG environment variable is set, CI mode will be enabled. | ||
* | ||
* @returns {boolean} True if CI mode should be used, false otherwise. | ||
*/ | ||
function shouldUseCIMode() { | ||
if (env.MSO_DISABLE_CI_MODE && isTruthy(env.MSO_DISABLE_CI_MODE)) | ||
return false; | ||
// Inspired by https://github.com/sindresorhus/is-in-ci | ||
if (isTruthy(env.CI) && | ||
('CI' in env || 'CONTINUOUS_INTEGRATION' in env || Object.keys(env).some((key) => key.startsWith('CI_')))) | ||
return true; | ||
if (env.DEBUG && isTruthy(env.DEBUG)) | ||
return true; | ||
return false; | ||
} | ||
const isInCi = shouldUseCIMode(); | ||
class CIMultiStageOutput { | ||
@@ -16,0 +38,0 @@ data; |
{ | ||
"name": "@oclif/multi-stage-output", | ||
"description": "Terminal output for oclif commands with multiple stages", | ||
"version": "0.5.3", | ||
"version": "0.5.4-qa.0", | ||
"author": "Salesforce", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/oclif/multi-stage-output/issues", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66449
1412