New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make install script POSIX compliant #53
Conversation
93a5525
to
e203b16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for the improvement!! I just have some questions (I put them in a review).
Sorry for the suggestions spam. A lot of this is redundant assignments passing values around. The gist of the program is as follows:
There may be more robust ways of doing OS detection in a POSIX friendly way, but uname(1) might be enough (what's the uname output on Windows systems?). Could steal some some ideas from https://github.com/dylanaraps/pfetch. Step 4 should probably be done as root. Can we call it a POSIX shell script if it makes calls to sudo? It may be better to suggest the user pipes the whole script into |
491b3dd
to
03cb191
Compare
@chambln I did all the changes you proposed. Could you check one more time before I merge? |
Sorry for being unresponsive, I've had limited FOSS time for the last few days. Anyway if you are still interested I'll gladly go through your questions and explain the rationale behind my choices. |
@vladimyr I am sorry, I took the initiative to push commits on your branch to merge faster. Even if the discussion is not terminated with @chambln, the result is way better than what we got before 😃
With great pleasure! Thanks for you contribution anyway. |
Looks much better already! If POSIX compliance is the goal then sudo must not be used in the script. I think it's wise to leave privilege elevation to the person running the script anyway. We can still suggest using sudo in curl ... | sudo sh |
Apart from being POSIX compliant this supports configuring install location through standard
PREFIX
environment variable, for example: