Skip to content

Commit 3b76427

Browse files
md37Terreii
authored andcommitted
fix: windows support (#873)
Co-Authored-By: Christopher <[email protected]>
1 parent f1c0e2f commit 3b76427

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"scripts": {
7272
"coverage": "tap --coverage-report=text-lcov | coveralls",
7373
"semantic-release": "semantic-release",
74-
"start": "./bin/start.js",
74+
"start": "node start.js",
7575
"pretest": "standard",
7676
"test": "tap --100 --jobs-auto './test/{unit,integration}/**/*-test.js'",
7777
"postinstall": "node ./bin/setup.js",

start.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var spawn = require('child_process').spawn
2+
var os = require('os')
3+
var start
4+
5+
function onLog (data) {
6+
console.log(data.toString())
7+
}
8+
9+
function onError (data) {
10+
console.error(data.toString())
11+
}
12+
13+
if (os.type() === 'Windows_NT') {
14+
start = spawn('node', ['bin\\start.js'])
15+
} else {
16+
start = spawn('./bin/start.js')
17+
}
18+
19+
start.stdout.on('data', onLog)
20+
start.stderr.on('data', onError)

0 commit comments

Comments
 (0)