qri-io / website

qri.io static site
https://qri.io
MIT License
20 stars 21 forks source link

curl one-liner install on home page fails without `sudo` #238

Closed feep closed 3 years ago

feep commented 4 years ago

Environment

What is your OS and version?

❯ hostnamectl| tail -n 3
  Operating System: Arch Linux
            Kernel: Linux 5.4.55-1-lts
      Architecture: x86-64

I believe install.sh would fail on any sane Linux system without sudo.

Without testing, I am pretty sure it would fail on a stock macOS install. One that hasn't had permissions weakened for Homebrew.

Issue

What did you do?

I ran the curl one-liner install from the home page.

curl -fsSL https://qri.io/install.sh | sh

What happened?

######################################################################## 100.0%##O=#  #        Warning: Failed to create the file /usr/local/bin/qri.zip: Permission denied  
                                                                           0.0%curl: (23) Failure writing output to destination

What did you expect to happen?

Successful install. Or at least catch the error and suggest sudo.

Do you have a suggested fix?

Either:

feep commented 4 years ago

(private) Discord:

b5: naw. I'm not a fan of putting sudo as part of a "run this, it's no big deal" b5: we should instead make the script smarter

...

feep: Brew checks for admin rights, then tells you to type sudo anyway. =] b5: yeah, let's do what brew does

feep commented 4 years ago

Brew script.

Brew sudo check.

feep commented 4 years ago

The Homebrew install probably requires bash. Their oneliner does not pipe to sh.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"