@oclif/multi-stage-output 0.5.3 → 0.5.4-qa.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/multi-stage-output.js +26 -4
- package/package.json +1 -1
|
@@ -7,10 +7,32 @@ import { Stages, } from './components/stages.js';
|
|
|
7
7
|
import { constructDesignParams } from './design.js';
|
|
8
8
|
import { StageTracker } from './stage-tracker.js';
|
|
9
9
|
import { readableTime } from './utils.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
function isTruthy(value) {
|
|
11
|
+
return value !== '0' && value !== 'false';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Determines whether the CI mode should be used.
|
|
15
|
+
*
|
|
16
|
+
* If the MSO_DISABLE_CI_MODE environment variable is set to a truthy value, CI mode will be disabled.
|
|
17
|
+
*
|
|
18
|
+
* If the CI environment variable is set, CI mode will be enabled.
|
|
19
|
+
*
|
|
20
|
+
* If the DEBUG environment variable is set, CI mode will be enabled.
|
|
21
|
+
*
|
|
22
|
+
* @returns {boolean} True if CI mode should be used, false otherwise.
|
|
23
|
+
*/
|
|
24
|
+
function shouldUseCIMode() {
|
|
25
|
+
if (env.MSO_DISABLE_CI_MODE && isTruthy(env.MSO_DISABLE_CI_MODE))
|
|
26
|
+
return false;
|
|
27
|
+
// Inspired by https://github.com/sindresorhus/is-in-ci
|
|
28
|
+
if (isTruthy(env.CI) &&
|
|
29
|
+
('CI' in env || 'CONTINUOUS_INTEGRATION' in env || Object.keys(env).some((key) => key.startsWith('CI_'))))
|
|
30
|
+
return true;
|
|
31
|
+
if (env.DEBUG && isTruthy(env.DEBUG))
|
|
32
|
+
return true;
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
const isInCi = shouldUseCIMode();
|
|
14
36
|
class CIMultiStageOutput {
|
|
15
37
|
data;
|
|
16
38
|
design;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oclif/multi-stage-output",
|
|
3
3
|
"description": "Terminal output for oclif commands with multiple stages",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.4-qa.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/multi-stage-output/issues",
|
|
7
7
|
"dependencies": {
|