@percy/cli-command 1.28.9-beta.0 → 1.28.9-beta.1
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/dist/command.js +9 -2
- package/package.json +5 -5
package/dist/command.js
CHANGED
|
@@ -58,8 +58,12 @@ function withBuiltIns(definition) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// Helper to throw an error with an exit code and optional reason message
|
|
61
|
-
function exit(exitCode, reason = '') {
|
|
61
|
+
function exit(exitCode, reason = '', shouldOverrideExitCode = true) {
|
|
62
|
+
let percyExitWithZeroOnError = process.env.PERCY_EXIT_WITH_ZERO_ON_ERROR === 'true';
|
|
63
|
+
exitCode = percyExitWithZeroOnError && shouldOverrideExitCode ? 0 : exitCode;
|
|
62
64
|
let err = reason instanceof Error ? reason : new Error(reason);
|
|
65
|
+
// Adding additional object so that it can be used in runner function below.
|
|
66
|
+
err.shouldOverrideExitCode = shouldOverrideExitCode;
|
|
63
67
|
throw Object.assign(err, {
|
|
64
68
|
exitCode
|
|
65
69
|
});
|
|
@@ -172,7 +176,10 @@ export function command(name, definition, callback) {
|
|
|
172
176
|
err.exitCode ?? (err.exitCode = 1);
|
|
173
177
|
err.message || (err.message = `EEXIT: ${err.exitCode}`);
|
|
174
178
|
if (definition.exitOnError) {
|
|
175
|
-
|
|
179
|
+
let shouldOverrideExitCode = err.shouldOverrideExitCode !== false;
|
|
180
|
+
let percyExitWithZeroOnError = process.env.PERCY_EXIT_WITH_ZERO_ON_ERROR === 'true';
|
|
181
|
+
let exitCode = percyExitWithZeroOnError && shouldOverrideExitCode ? 0 : err.exitCode;
|
|
182
|
+
process.exit(exitCode);
|
|
176
183
|
}
|
|
177
184
|
|
|
178
185
|
// re-throw when not exiting
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/cli-command",
|
|
3
|
-
"version": "1.28.9-beta.
|
|
3
|
+
"version": "1.28.9-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"test:coverage": "yarn test --coverage"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@percy/config": "1.28.9-beta.
|
|
40
|
-
"@percy/core": "1.28.9-beta.
|
|
41
|
-
"@percy/logger": "1.28.9-beta.
|
|
39
|
+
"@percy/config": "1.28.9-beta.1",
|
|
40
|
+
"@percy/core": "1.28.9-beta.1",
|
|
41
|
+
"@percy/logger": "1.28.9-beta.1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "bc0085f5c8ad4e86ac643618579d541c3bbcaf0b"
|
|
44
44
|
}
|