Skip to content

Commit 8ea6a10

Browse files
committed
add back node 0.10, 0.12 support; fix warning
use cross-spawn to fix warning
1 parent 61a54d1 commit 8ea6a10

4 files changed

Lines changed: 21 additions & 6 deletions

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ language: node_js
22
node_js:
33
- '4'
44
- 'node'
5+
- '0.12'
6+
- '0.10'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"devDependencies": {
2424
"babel-eslint": "^6.0.0",
25-
"cross-spawn-async": "^2.1.8",
25+
"cross-spawn": "^3.0.1",
2626
"minimist": "^1.2.0",
2727
"mkdirp": "^0.5.1",
2828
"run-parallel-limit": "^1.0.2",

test/clone.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* VERSION BUMP.)
99
*/
1010

11-
var crossSpawnAsync = require('cross-spawn-async')
11+
var crossSpawn = require('cross-spawn')
1212
var fs = require('fs')
1313
var minimist = require('minimist')
1414
var mkdirp = require('mkdirp')
@@ -68,7 +68,7 @@ test('test github repos that use `standard`', function (t) {
6868
var url = pkg.repo + '.git'
6969
var folder = path.join(TMP, name)
7070
return function (cb) {
71-
fs.access(path.join(TMP, name), fs.R_OK | fs.W_OK, function (err) {
71+
access(path.join(TMP, name), fs.R_OK | fs.W_OK, function (err) {
7272
if (argv.offline) {
7373
if (err) {
7474
t.pass('SKIPPING (offline): ' + name + ' (' + pkg.repo + ')')
@@ -122,11 +122,24 @@ test('test github repos that use `standard`', function (t) {
122122
function spawn (command, args, opts, cb) {
123123
if (!opts.stdio) opts.stdio = argv.quiet ? 'ignore' : 'inherit'
124124

125-
var child = crossSpawnAsync(command, args, opts)
125+
var child = crossSpawn(command, args, opts)
126126
child.on('error', cb)
127127
child.on('close', function (code) {
128128
if (code !== 0) return cb(new Error('non-zero exit code: ' + code))
129129
cb(null)
130130
})
131131
return child
132132
}
133+
134+
function access (path, mode, callback) {
135+
if (typeof mode === 'function') {
136+
return access(path, null, callback)
137+
}
138+
139+
// Node v0.10 lacks `fs.access`, which is faster, so fallback to `fs.stat`
140+
if (typeof fs.access === 'function') {
141+
fs.access(path, mode, callback)
142+
} else {
143+
fs.stat(path, callback)
144+
}
145+
}

test/cmd.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
var path = require('path')
22
var test = require('tape')
3-
var crossSpawnAsync = require('cross-spawn-async')
3+
var crossSpawn = require('cross-spawn')
44

55
var CMD_PATH = path.join(__dirname, '..', 'bin', 'cmd.js')
66

77
test('command line usage: --help', function (t) {
88
t.plan(1)
99

10-
var child = crossSpawnAsync(CMD_PATH, ['--help'])
10+
var child = crossSpawn(CMD_PATH, ['--help'])
1111
child.on('error', function (err) {
1212
t.fail(err)
1313
})

0 commit comments

Comments
 (0)