From f4f6c6e8151071d6d866603d0837d851fdf49157 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 13 May 2016 22:24:12 +0200 Subject: [PATCH] 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 Reviewed-By: Myles Borins --- lib/child_process.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/child_process.js b/lib/child_process.js index 81fb8c1fcd0fe8..4fda6e20e53902 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]; } }