tidal-bootstrap icon indicating copy to clipboard operation
tidal-bootstrap copied to clipboard

fix bash startup file updating

Open 76creates opened this issue 4 years ago • 11 comments

  • case for mac users: not all have .bashrc, I personally have .profile instead, added redundancy to that step by checking for startup files in order by which bash searches for them
  • fixed -ne 0 to -eq 0 to avoid adding source multiple times

76creates avatar Nov 05 '20 20:11 76creates

just a ping give it a look, time was invested, would be a waste for it to end like this :)

76creates avatar Jul 06 '21 18:07 76creates

Apologies @76creates, I've only just seen this old PR!

I know @HighHarmonics2 is working on this and might have a thought about whether this can be integrated with their work.

yaxu avatar Dec 26 '22 15:12 yaxu

Yes, I'm working on a full refactor and will add a branch with that work soon. The changes proposed by @76creates look good and shouldn't impact what I'm doing. I will give a closer look and figure out how to proceed.

HighHarmonics2 avatar Dec 26 '22 17:12 HighHarmonics2

I looked into this and I don't think we can merge this code as is. The intention is right - to allow for all possible shell profile variants: .bashrc, .bash_profile, .bash_login, .profile. The problem comes if you have multiple shell profiles. This can come from using different shells, or other factors. I have 3: .bashrc, .bash_profile, and .zshrc, which is for the new default shell = zsh.

With this change, the conditional will keep testing for the different profile files and only update the last one it finds in the list. Also, .zshrc is missing, but that would be easy to add one more.

It would be possible to refactor this so all profiles discovered would get the .ghcup/env commands. @yaxu - what is your input?

HighHarmonics2 avatar Dec 27 '22 01:12 HighHarmonics2

@76creates I see you are following this thread! Would you be willing to refactor your PR to add .zshrc and to add the .ghcup/env commands to all shell profile files found? Since this PR is still open, I think you could just add an additional commit. @yaxu Nice to see you haven't lost interest!

HighHarmonics2 avatar Dec 28 '22 02:12 HighHarmonics2

@HighHarmonics2 for sure, lemme see what I can brew and I will post it over the weekend ⚡

76creates avatar Dec 28 '22 10:12 76creates

@76creates OK the refactor branch has been merged. So master now has the current version with some changes to the relevant section you are contributing. I'm not sure if that means you can modify this PR with new commits, or if you would need to start over.

HighHarmonics2 avatar Dec 30 '22 20:12 HighHarmonics2

Would be great to resolve this issue.

I was confused why ghci wasn't in my shell path because source ${HOME}/.ghcup/env only ended up in .bashrc and not .bash_profile.

Otherwise the script worked flawlessly!

htor avatar Mar 12 '24 21:03 htor

Would be great to resolve this issue.

I was confused why ghci wasn't in my shell path because source ${HOME}/.ghcup/env only ended up in .bashrc and not .bash_profile.

Otherwise the script worked flawlessly!

Ye sorry, this one got off my radar completely. Will try to fix something up in few days time.

76creates avatar Mar 13 '24 10:03 76creates

@HighHarmonics2 finally updated the script, give it a look ⚡

76creates avatar Mar 23 '24 14:03 76creates

@HighHarmonics2 finally updated the script, give it a look ⚡

Thanks @76creates. I'll look into this. It may take a few days to get familiar with the code again. It's been awhile since I worked on this.

HighHarmonics2 avatar Mar 27 '24 03:03 HighHarmonics2