summaryrefslogtreecommitdiff
path: root/lib/child_process.js
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2016-05-13 22:24:12 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2016-05-14 12:04:36 +0200
commitf4f6c6e8151071d6d866603d0837d851fdf49157 (patch)
tree6b4828c850d0d3fec4cf7df1c60fc17ea834ba96 /lib/child_process.js
parent1a0c80a1da361b46e45ad6c4478233cc70155761 (diff)
downloadandroid-node-v8-f4f6c6e8151071d6d866603d0837d851fdf49157.tar.gz
android-node-v8-f4f6c6e8151071d6d866603d0837d851fdf49157.tar.bz2
android-node-v8-f4f6c6e8151071d6d866603d0837d851fdf49157.zip
child_process: use /system/bin/sh on android
`/bin/sh` does not exist on Android but `/system/bin/sh` does. PR-URL: https://github.com/nodejs/node/pull/6745 Refs: https://github.com/nodejs/node/pull/6733 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'lib/child_process.js')
-rw-r--r--lib/child_process.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/child_process.js b/lib/child_process.js
index 81fb8c1fcd..4fda6e20e5 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -332,7 +332,12 @@ function normalizeSpawnArguments(file /*, args, options*/) {
args = ['/s', '/c', '"' + command + '"'];
options.windowsVerbatimArguments = true;
} else {
- file = typeof options.shell === 'string' ? options.shell : '/bin/sh';
+ if (typeof options.shell === 'string')
+ file = options.shell;
+ else if (process.platform === 'android')
+ file = '/system/bin/sh';
+ else
+ file = '/bin/sh';
args = ['-c', command];
}
}