+36
-7
lines changedFilter options
+36
-7
lines changed Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
7
7
/configure text eol=lf
8
8
9
9
# our cmd scripts always need to be CRLF
10
-
/bin/*.cmd text eol=crlf
10
+
/bin/**/*.cmd text eol=crlf
11
11
12
12
# ignore all line endings in node_modules since we dont control that
13
13
/node_modules/** -text
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1
+
#!/usr/bin/env sh
2
+
if [ "x$npm_config_node_gyp" = "x" ]; then
3
+
node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@"
4
+
else
5
+
"$npm_config_node_gyp" "$@"
6
+
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1
+
if not defined npm_config_node_gyp (
2
+
node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %*
3
+
) else (
4
+
node "%npm_config_node_gyp%" %*
5
+
)
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
1
1
const t = require('tap')
2
2
const { spawnSync } = require('child_process')
3
3
const { resolve, join, extname, basename, sep } = require('path')
4
-
const { copyFileSync, readFileSync, chmodSync, readdirSync, rmSync } = require('fs')
4
+
const { copyFileSync, readFileSync, chmodSync, readdirSync, rmSync, statSync } = require('fs')
5
5
const Diff = require('diff')
6
6
const { sync: which } = require('which')
7
7
const { version } = require('../../package.json')
8
8
9
-
const ROOT = resolve(__dirname, '../..')
10
-
const BIN = join(ROOT, 'bin')
11
-
const SHIMS = readdirSync(BIN).reduce((acc, shim) => {
12
-
if (extname(shim) !== '.js') {
13
-
acc[shim] = readFileSync(join(BIN, shim), 'utf-8')
9
+
const readNonJsFiles = (dir) => readdirSync(dir).reduce((acc, shim) => {
10
+
const p = join(dir, shim)
11
+
if (extname(p) !== '.js' && !statSync(p).isDirectory()) {
12
+
acc[shim] = readFileSync(p, 'utf-8')
14
13
}
15
14
return acc
16
15
}, {})
17
16
17
+
const ROOT = resolve(__dirname, '../..')
18
+
const BIN = join(ROOT, 'bin')
19
+
const SHIMS = readNonJsFiles(BIN)
20
+
const NODE_GYP = readNonJsFiles(join(BIN, 'node-gyp-bin'))
18
21
const SHIM_EXTS = [...new Set(Object.keys(SHIMS).map(p => extname(p)))]
19
22
20
23
// windows requires each segment of a command path to be quoted when using shell: true
@@ -63,6 +66,21 @@ t.test('shim contents', t => {
63
66
})
64
67
})
65
68
69
+
t.test('node-gyp', t => {
70
+
// these files need to exist to avoid breaking yarn 1.x
71
+
72
+
for (const [key, file] of Object.entries(NODE_GYP)) {
73
+
t.match(file, /npm_config_node_gyp/, `${key} contains env var`)
74
+
t.match(
75
+
file,
76
+
/[\\/]\.\.[\\/]\.\.[\\/]node_modules[\\/]node-gyp[\\/]bin[\\/]node-gyp\.js/,
77
+
`${key} contains path`
78
+
)
79
+
}
80
+
81
+
t.end()
82
+
})
83
+
66
84
t.test('run shims', t => {
67
85
const path = t.testdir({
68
86
...SHIMS,
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4