Skip to content

Commit 35eceb5

Browse files
authored
feat: add run-ci and run-local bins (#148)
1 parent e161aa2 commit 35eceb5

File tree

4 files changed

+43
-5
lines changed

4 files changed

+43
-5
lines changed

bin/run_ci.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env node
2+
'use strict'
3+
4+
const process = require('process')
5+
6+
const execa = require('execa')
7+
const isCI = require('is-ci')
8+
9+
const [, , command] = process.argv
10+
11+
const runCI = async function () {
12+
if (isCI) {
13+
await execa.command(command, { stdio: 'inherit' })
14+
}
15+
}
16+
17+
runCI()

bin/run_local.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env node
2+
'use strict'
3+
4+
const process = require('process')
5+
6+
const execa = require('execa')
7+
const isCI = require('is-ci')
8+
9+
const [, , command] = process.argv
10+
11+
const runLocal = async function () {
12+
if (!isCI) {
13+
await execa.command(command, { stdio: 'inherit' })
14+
}
15+
}
16+
17+
runLocal()

package-lock.json

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"bin"
1313
],
1414
"bin": {
15-
"run-e": "./bin/run_e.js"
15+
"run-e": "./bin/run_e.js",
16+
"run-ci": "./bin/run_ci.js",
17+
"run-local": "./bin/run_local.js"
1618
},
1719
"scripts": {
1820
"test": "run-s format test:dev",
@@ -91,6 +93,7 @@
9193
"eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0",
9294
"execa": "^5.0.0",
9395
"husky": "^4.3.0",
96+
"is-ci": "^2.0.0",
9497
"npm-run-all": "^4.1.5",
9598
"prettier": "^2.1.2"
9699
},

0 commit comments

Comments
 (0)