1
0
Fork 0
mirror of https://cgit.krebsco.de/krops synced 2024-12-23 02:09:51 +01:00

fix local deployment with sudo

This commit is contained in:
Jörg Thalheim 2020-06-22 15:38:35 +01:00
parent 56a066d470
commit bdf56191e2
No known key found for this signature in database
GPG key ID: 003F2096411B5F92

View file

@ -18,8 +18,11 @@ in
}";
runShell = target: command:
if lib.isLocalTarget target
then command
let
command' = if target.sudo then "sudo ${command}" else command;
in
if lib.isLocalTarget target
then command'
else
writers.writeDash "krops.${target.host}.${lib.firstWord command}" ''
exec ${openssh}/bin/ssh ${lib.escapeShellArgs (lib.flatten [
@ -28,7 +31,7 @@ in
"-T"
target.extraOptions
target.host
(if target.sudo then "sudo ${command}" else command)])}
command'])}
'';
writeCommand = name: {