Skip to content

Commit

Permalink
fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexei-led committed Mar 27, 2020
1 parent 47aacbb commit 995a0a6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ func run(ctx context.Context, provider secrets.Provider, commandSlice []string)
log.WithError(err).Error("failed to resolve secrets")
}

// start the specified command
log.WithFields(log.Fields{
"command": commandStr,
"args": argsSlice,
"env": cmd.Env,
}).Debug("starting command")
err = cmd.Start()
if err != nil {
log.WithError(err).Error("failed to start command")
return err
}

// Goroutine for signals forwarding
go func() {
for sig := range sigs {
Expand All @@ -162,18 +174,6 @@ func run(ctx context.Context, provider secrets.Provider, commandSlice []string)
}
}()

// start the specified command
log.WithFields(log.Fields{
"command": commandStr,
"args": argsSlice,
"env": cmd.Env,
}).Debug("starting command")
err = cmd.Start()
if err != nil {
log.WithError(err).Error("failed to start command")
return err
}

// wait for the command to exit
err = cmd.Wait()
if err != nil {
Expand Down

0 comments on commit 995a0a6

Please sign in to comment.