chore(cmd): trim space in command

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2019-11-21 09:13:04 +08:00
parent 648e3c1321
commit 9b57f85e47
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -195,6 +195,9 @@ func (p Plugin) scriptCommands() []string {
commands := make([]string, 0)
for _, cmd := range scripts {
if strings.TrimSpace(cmd) == "" {
continue
}
commands = append(commands, cmd)
if p.Config.ScriptStop {
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;")