@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcoreio/toolchain",
3
- "version": "5.5.3",
3
+ "version": "5.5.4",
4
4
  "description": "base JS build toolchain",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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
- console.error('Unknown command:', command) // eslint-disable-line no-console
93
- process.exit(1)
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) {