4 ms·
> I guess people get touchy when you start editing their startup scripts? I'm definitely one of those people. The startup script is my personal configuration,
by MereInterest 5y ago
> I guess people get touchy when you start editing their startup scripts?
I'm definitely one of those people. The startup script is my personal configuration, under source control and managed to set up an environment exactly how I want it. The very first thing I do on a new computer is clone that repo, so that I have my standard working environment available. It's definitely not a dumping ground for anything that has just been installed.
> I agree that it would be pretty easy for the installer to check and add the lines if they are missing.
But this is where it gets difficult, because that's in no way an easy thing to check. My .bashrc sources a .bashrc_local, so that I can have some computer-specific settings. It has conditionals, based on what tools are available on the current machine. Heck, some of the commands are generated by a python script, such as coloring the PS1 pseudorandomly based on the hostname, so I can tell at a glance which computer I'm ssh'ed into.
(Side note, I definitely need to clean it out at some point, as it has definitely accumulated a lot of cruft over the years.)
Determining if a particular script is sourced requires solving the halting problem. Granted, doing a quick grep for the name of the setup script is probably sufficient, but an installer shouldn't be editing my setup script even if it doesn't find anything.
- pjerem 5y agoAt least it could ask if you want it to add it for you. I’d answer yes, you’ll answer no and everybody would be happy.
- comex 5y agoDefinitely not without asking. But I think giving a yes/no prompt for whether to add the line is reasonable. One counter-argument might be that if the user doesn’t add it themselves, they’re less likely to remember where it is so they can remove it if needed. However, Homebrew already gives you a command to add it that you can blindly copy and paste, which is already not going to stimulate memory very much. I don’t think the script doing it automatically is any worse, as long as it makes sure to explain what it’s doing – that is, display the line it’s adding and the path it’s adding it to.