@jcoreio/toolchain 5.5.3 → 5.5.4
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/package.json +1 -1
- package/scripts/toolchain.cjs +10 -2
package/package.json
CHANGED
package/scripts/toolchain.cjs
CHANGED
|
@@ -71,6 +71,10 @@ const scripts =
|
|
|
71
71
|
exports.scripts = scripts
|
|
72
72
|
|
|
73
73
|
async function toolchain(command, args) {
|
|
74
|
+
const ifCommandExists = args.includes('--if-command-exists')
|
|
75
|
+
if (ifCommandExists) {
|
|
76
|
+
args.splice(args.indexOf('--if-command-exists'), 1)
|
|
77
|
+
}
|
|
74
78
|
if (!command) {
|
|
75
79
|
/* eslint-disable no-console */
|
|
76
80
|
console.error('Usage: toolchain <command> <arguments...>\n')
|
|
@@ -89,8 +93,12 @@ async function toolchain(command, args) {
|
|
|
89
93
|
}
|
|
90
94
|
const script = scripts[command]
|
|
91
95
|
if (!script) {
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
if (ifCommandExists) {
|
|
97
|
+
process.exit(0)
|
|
98
|
+
} else {
|
|
99
|
+
console.error('Unknown command:', command) // eslint-disable-line no-console
|
|
100
|
+
process.exit(1)
|
|
101
|
+
}
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
if (require.main === module && script !== scripts.version) {
|