This repository was archived by the owner on Aug 11, 2022. It is now read-only.
File tree Expand file treeCollapse file tree 4 files changed+28
-1
lines changedFilter options
+28
-1
lines changed Original file line number Diff line number Diff line change
@@ -889,6 +889,13 @@ in to a private registry for the first time:
889
889
will cause `@organization` to be mapped to the registry for future installation
890
890
of packages specified according to the pattern `@organization/package`.
891
891
892
+
### script-shell
893
+
894
+
* Default: `null`
895
+
* Type: path
896
+
897
+
The shell to use for scripts run with the `npm run` command.
898
+
892
899
### scripts-prepend-node-path
893
900
894
901
* Default: "warn-only"
Original file line number Diff line number Diff line change
@@ -203,6 +203,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
203
203
'save-prefix': '^',
204
204
'save-prod': false,
205
205
scope: '',
206
+
'script-shell': null,
206
207
'scripts-prepend-node-path': 'warn-only',
207
208
searchopts: '',
208
209
searchexclude: null,
@@ -326,6 +327,7 @@ exports.types = {
326
327
'save-prefix': String,
327
328
'save-prod': Boolean,
328
329
scope: String,
330
+
'script-shell': [null, String],
329
331
'scripts-prepend-node-path': [false, true, 'auto', 'warn-only'],
330
332
searchopts: String,
331
333
searchexclude: [null, String],
Original file line number Diff line number Diff line change
@@ -264,7 +264,11 @@ function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) {
264
264
var sh = 'sh'
265
265
var shFlag = '-c'
266
266
267
-
if (process.platform === 'win32') {
267
+
var customShell = npm.config.get('script-shell')
268
+
269
+
if (customShell) {
270
+
sh = customShell
271
+
} else if (process.platform === 'win32') {
268
272
sh = process.env.comspec || 'cmd'
269
273
shFlag = '/d /s /c'
270
274
conf.windowsVerbatimArguments = true
Original file line number Diff line number Diff line change
@@ -75,6 +75,14 @@ var exitCode = {
75
75
}
76
76
}
77
77
78
+
var shell = {
79
+
name: 'scripted',
80
+
version: '1.2.3',
81
+
scripts: {
82
+
'start': 'echo foo'
83
+
}
84
+
}
85
+
78
86
function testOutput (t, command, er, code, stdout, stderr) {
79
87
var lines
80
88
@@ -308,6 +316,12 @@ test('npm run-script no-params (direct only)', function (t) {
308
316
})
309
317
})
310
318
319
+
test('npm run-script script-shell config', function (t) {
320
+
writeMetadata(shell)
321
+
322
+
common.npm(['run-script', 'start', '--script-shell', 'echo'], opts, testOutput.bind(null, t, '-c echo foo'))
323
+
})
324
+
311
325
test('npm run-script no-params (direct only)', function (t) {
312
326
var expected = [
313
327
'Lifecycle scripts included in scripted:',
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