Skip to content

Commit

Permalink
Support interactive commands (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
gopinath-langote authored Aug 16, 2020
1 parent 4963786 commit 4ef9066
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package exec

import (
"fmt"
"os"
"time"

"github.com/codeskyblue/go-sh"
Expand Down Expand Up @@ -45,7 +46,9 @@ func ExecutePlan(commands ...string) {
func executeAndStopIfFailed(command *models.CommandContext, executeStart time.Time) {
command.PrintPhaseBanner()
if !viper.GetBool("quiet") {
err := command.CommandSession.Run()
session := command.CommandSession
session.SetStdin(os.Stdin)
err := session.Run()
if err != nil {
exitCode := (err.Error())[12:]
text := "\nExecution failed in phase '" + command.Name + "' – exit code: " + exitCode
Expand Down

0 comments on commit 4ef9066

Please sign in to comment.