Fix edo in bootstrap-haskell

This seems to have caused occasional weird
side-effects on the following line:

  edo curl https://raw.githubusercontent.com/haskell/ghcup/master/ghcup > "${HOME}"/.ghcup/bin/ghcup
  ...
  edo ghcup install

It would result in:

  ~/.ghcup/bin/ghcup: line 1: $'\E[0': command not found
  ~/.ghcup/bin/ghcup: line 1: 35mcurl: command not found

which seems to be because of printf and the piping command.
It's not entirely clear to me what happens here, but it
seems part of the printf output to stdout where mixed
with the next command.
This commit is contained in:
Julian Ospald 2019-01-24 14:18:47 +08:00
parent b60e546e9a
commit 99843f3201
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -10,7 +10,7 @@ die() {
edo()
{
printf "\\033[0;35m%s\\033[0m\\n" "$*"
(>&2 printf "\\033[0;35m%s\\033[0m\\n" "$*")
"$@" || exit 2
}