mirror of
https://cgit.krebsco.de/krops
synced 2024-06-02 06:13:30 +02:00
fix local deployment with sudo
This commit is contained in:
parent
56a066d470
commit
bdf56191e2
|
@ -18,8 +18,11 @@ in
|
||||||
}";
|
}";
|
||||||
|
|
||||||
runShell = target: command:
|
runShell = target: command:
|
||||||
if lib.isLocalTarget target
|
let
|
||||||
then command
|
command' = if target.sudo then "sudo ${command}" else command;
|
||||||
|
in
|
||||||
|
if lib.isLocalTarget target
|
||||||
|
then command'
|
||||||
else
|
else
|
||||||
writers.writeDash "krops.${target.host}.${lib.firstWord command}" ''
|
writers.writeDash "krops.${target.host}.${lib.firstWord command}" ''
|
||||||
exec ${openssh}/bin/ssh ${lib.escapeShellArgs (lib.flatten [
|
exec ${openssh}/bin/ssh ${lib.escapeShellArgs (lib.flatten [
|
||||||
|
@ -28,7 +31,7 @@ in
|
||||||
"-T"
|
"-T"
|
||||||
target.extraOptions
|
target.extraOptions
|
||||||
target.host
|
target.host
|
||||||
(if target.sudo then "sudo ${command}" else command)])}
|
command'])}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
writeCommand = name: {
|
writeCommand = name: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user