1
0
Fork 0
mirror of https://cgit.krebsco.de/krops synced 2024-11-23 03:29:48 +01:00

runShell: admit non-posix-compatible shells

This commit is contained in:
tv 2022-09-07 11:17:39 +02:00
parent 625bd446dd
commit 6ee1d00b92

View file

@ -19,7 +19,10 @@ in
allocateTTY ? false
}: command:
let
command' = if target.sudo then "sudo ${command}" else command;
command' = /* sh */ ''
${lib.optionalString target.sudo "sudo"} \
/bin/sh -c ${lib.escapeShellArg command}
'';
in
if lib.isLocalTarget target
then command'