Skip to content
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

Support setting PATH in multiple shells #15

Open
joeweaver opened this issue Mar 7, 2021 · 2 comments
Open

Support setting PATH in multiple shells #15

joeweaver opened this issue Mar 7, 2021 · 2 comments

Comments

@joeweaver
Copy link
Contributor

joeweaver commented Mar 7, 2021

Right now, the install script assumes bash and doesn't update the correct *rc file for other shells. In my case, I use Zsh and the relevant file is ~/.zshrc.

In that specific case, it's easy enough to check for a ~/.zshrc file and update that instead of (or in addition to?) ~/.bashrc. There's also the option to do something smart by checking whatever $SHELL is set to.

Thinking about supporting additional shells is what makes this a bit more complicated. I assume things like FISH, and OIL have similar files, but I'm not familiar with them so that makes testing/maintenance hard.

On the other hand, requiring devs to live in bash is a bit restrictive.

We probably shouldn't be directly updating the user's rc files anyway. I know one approach, such as used by OpenFoam, is to:

  1. Create an rc snippet in somewhere user-accessble (like $HOME/.config/<appname>)
  2. On installation tell the user to source $HOME/.config/<appname>/.<shell>rc when they want to run the app
  3. Assume users who don't want to source every time/use a different shell know enough will be able to grab the relevant bits from that file and
    a. Incorporate it into their ~/.rc
    b. Adapt the snippet to their preferred shell

Not a big deal overall, just trying to log these as issues while I'm still a beginner at NUFEB dev and before I forget them.

There's similar issues with the third party installs, which should be written up as an issue as well.

@shelllbw
Copy link
Member

Thanks, Joe. That's helpful. I will find a time to improve this.

@joeweaver
Copy link
Contributor Author

I'm happy to do the implementation.

Which approach do you think is better?

  1. directly editing the rc files for diffrent shells or
  2. the OpenFOAM style bash-snippet approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants