We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e4b02a commit edd316bCopy full SHA for edd316b
1 file changed
src/index.ts
@@ -242,7 +242,17 @@ export const spawning = (Sys.spawning = function (
242
243
if (sudo) {
244
argument = [command].concat(argument);
245
- command = isWindows() ? join(__dirname, 'bin', 'sudo.bat') : 'sudo';
+
246
+ // sudo
247
+ if (isWindows()) {
248
+ command = join(__dirname, 'bin', 'sudo.bat');
249
+ } else {
250
+ if (where('sudo') !== null) {
251
+ command = 'sudo';
252
253
+ command = '';
254
+ }
255
256
}
257
258
const spawned = spawn(command, argument, options);
0 commit comments