Skip to content

Commit

Permalink
Check if stdin is a tty and add docker flag accordingly (#34)
Browse files Browse the repository at this point in the history
Fixes #33

TODO: do the same thing in powershell for the windows provider
  • Loading branch information
marcosnils authored Nov 22, 2020
1 parent 87f51ca commit 1abfb2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/providers/docker_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const (
// TODO: there might be a way were users can configure a template for the
// actual execution since some CLIs require some other folders to be mounted
// or networks to be shared
sh = `docker run --rm -i -t -v ${PWD}:/tmp/cmd -w /tmp/cmd %s:%s "$@"`
sh = `
termflag=$([ -t 0 ] && echo -n "-t")
docker run --rm -i $termflag -v ${PWD}:/tmp/cmd -w /tmp/cmd %s:%s "$@"`
)

// getImageName gets the name of the image from the image repo.
Expand Down

0 comments on commit 1abfb2a

Please sign in to comment.