jpillora / installer

One-liner for installing binaries from Github releases
https://i.jpillora.com/installer
MIT License
211 stars 51 forks source link

installer --version outputs to stderr. #11

Open nicholaswilde opened 3 years ago

nicholaswilde commented 3 years ago

When running installer --version, the output is directed to stderr instead of stdout. Also, a return character needs to be added to the end.

Referencing this article.

Expected behavior.

$ ./installer --version
0.2.9
$ ./installer --version 1> out.txt 2> error.txt && cat out.txt
0.2.9
$ ./installer --version 1> out.txt 2> error.txt && cat error.txt
null

Actual behavior.

$ ./installer --version
0.2.9$
$ ./installer --version 1> out.txt 2> error.txt && cat out.txt
null
$ ./installer --version 1> out.txt 2> error.txt && cat error.txt
0.2.9$

Environment

$ cat /etc/*-release
NAME="Ubuntu"
VERSION="20.10 (Groovy Gorilla)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.10"
VERSION_ID="20.10"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=groovy
UBUNTU_CODENAME=groovy
jpillora commented 3 years ago

Agreed. Should go to stdout. Issue belongs https://github.com/jpillora/opts here though. No idea why I decided on stderr many years ago, trying to think now if this change could break anything...

nicholaswilde commented 3 years ago

I appreciate you looking into this.