pkill37 / linuxify

🍏🐧 Transparently transform the macOS CLI into a fresh GNU/Linux CLI experience.
MIT License
888 stars 69 forks source link

source ~/.linuxify #2

Closed pkill37 closed 5 years ago

pkill37 commented 5 years ago

For everything to work correctly, the script adds source ~/.linuxify to ~/.bashrc. But this assumes:

  1. that the user is using bash
  2. that ~/.bashrc does not use commands that will only work after the $PATH has been patched (e.g. export MAKEFLAGS="-j$(nproc)" will fail if declared before source ~/.linuxify because nproc is not yet in the $PATH)

Should the script continue to try to add source ~/.linuxify to ~/.bashrc. like this or should the users be responsible for handling this stitching themselves?

pkill37 commented 5 years ago

I suppose assumption 2 is not a problem if I prepend to ~/.bashrc rather than append, which I have committed.

And I guess I could argue that assumption 1 is acceptable because I'm going for a default/typical GNU/Linux installation, so the script should not acknowledge different shells like zsh or fish.

Still, I'll leave this open for a while.

zmilonas commented 5 years ago

I think appending something to users' profile is kind of unwanted.

If user is competent enough to run this script, they're competent enough to add it to their profile accordingly

pkill37 commented 5 years ago

Actually I may be inclined to agree with you @zmilonas. Rather than scripting it I could just print the instructions to the user. It loses the "one step install" aspect to it though...

andrewzah commented 5 years ago

Plenty of things append an install with instructions to "add to your ~/.bashrc or equivalent". Even if it supported my shell (zsh), automatically appending would be annoying because I structure my dotfiles in a particular way, etc.

pkill37 commented 5 years ago

automatically appending would be annoying because I structure my dotfiles in a particular way, etc.

Yeah that's very true. I didn't like it much either. But I still stuck to it in the spirit of an automagical one-step install.

I'll probably change this tonight.

techwizrd commented 5 years ago

I'll add that I'm using fish, so it'd probably be better to add an instruction at the end of the install requesting the user add . linuxify.sh/source linuxify.sh to their .bashrc/.zshrc/config.fish/etc.

pkill37 commented 5 years ago

Alright I've changed the behavior of the script in https://github.com/fabiomaia/linuxify/commit/9140a9c4da69994f753c9a5159133d18686b4fd6

Any comments?

techwizrd commented 5 years ago

LGTM. :+1: