mirror of
https://github.com/appleboy/drone-ssh.git
synced 2026-06-04 18:24:01 +08:00
chore: support Multiline SSH commands interpreted as single lines (#160)
https://github.com/appleboy/ssh-action/issues/75
This commit is contained in:
@@ -207,11 +207,12 @@ func (p Plugin) scriptCommands() []string {
|
||||
commands := make([]string, 0)
|
||||
|
||||
for _, cmd := range scripts {
|
||||
cmd = strings.TrimSpace(cmd)
|
||||
if strings.TrimSpace(cmd) == "" {
|
||||
continue
|
||||
}
|
||||
commands = append(commands, cmd)
|
||||
if p.Config.ScriptStop {
|
||||
if p.Config.ScriptStop && cmd[(len(cmd)-1):] != "\\" {
|
||||
commands = append(commands, "DRONE_SSH_PREV_COMMAND_EXIT_CODE=$? ; if [ $DRONE_SSH_PREV_COMMAND_EXIT_CODE -ne 0 ]; then exit $DRONE_SSH_PREV_COMMAND_EXIT_CODE; fi;")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user