scopatz / nanorc

Improved Nano Syntax Highlighting Files
Other
3k stars 549 forks source link

The installer requires wget #350

Open hjpotter92 opened 3 years ago

hjpotter92 commented 3 years ago

I was setting up nanorc for my newer install on office machine, and I went with the installation script with curl.

However, since I hadn't installed wget on the system, the installation script failed:

➜ curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1177  100  1177    0     0   1693      0 --:--:-- --:--:-- --:--:--  1691
main: line 10: wget: command not found
unzip:  cannot find or open /tmp/nanorc.zip, /tmp/nanorc.zip.zip or /tmp/nanorc.zip.ZIP.
mv: cannot stat 'nanorc-master/*': No such file or directory
rm: cannot remove '/tmp/nanorc.zip': No such file or directory
main: line 20: /home/hjpotter92/.nano/nanorc: No such file or directory

The installer should switch between curl or wget accordingly, and it should fail as early as possible. In the output above, it can be seen that despite wget not being found, the installer still attempts to unzip/mv/rm as if previous stages were successful.

LoganDark commented 3 years ago

As for curl or wget: they should be using curl anyway as it has the widest compatibility.

As for stopping the whole script when an error is encountered: that is impossible when the recommended method of installation is piping input to your shell. see: https://www.seancassidy.me/dont-pipe-to-your-shell.html

However, they can (and should) check the output of each command individually.