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 post-install? #69

Open
sanchitram1 opened this issue May 20, 2023 · 3 comments
Open

Support post-install? #69

sanchitram1 opened this issue May 20, 2023 · 3 comments
Labels
question Further information is requested

Comments

@sanchitram1
Copy link

I encountered this issue while packaging zsh-syntax-highlighting (#2000) that requires something to be added to $HOME/.zshrc. Should we create a way to modify a user's system post-install? Certain packages definitely require it.

Context: Here's what I see for $HOME.

# Inside the package.yaml
$ echo $HOME 
'/Users/sanch/tea/pkgdev/pantry/builds/github.com\342\210\225zsh-users\342\210\225zsh-syntax-highlighting-0.7.1+darwin/xyz.tea.home'

# In zsh
$ echo $HOME
/Users/sanch

We could use something like {{home}} to refer to the user's home directory.

@jhheider
Copy link
Contributor

Hopefully we don't need post-install scripts, but realistically we will eventually (think setting up servers). The general solution, if provided, would be use environment variables via runtime.env.FOO: {{prefix}}/etc/whatever if zsh provides them.

@sanchitram1
Copy link
Author

You can use ZDOTDIR to configure zsh to look in a different directory instead of HOME. But, it's blank by default, since .zshrc is in HOME.

What about find ~ -name .zshrc -print -quit to find and print the first result? Since it's looking in ~, it should find HOME first?

@jhheider
Copy link
Contributor

I mean, you can find a .zshrc, if one exists, on the build machine. I guess if you were just an awful person, this might work:

runtime:
  env:
    _FOO: $(echo "source {{prefix}}/etc/zsh_completion.zsh" >> ${ZDOTDIR:=~}/.zshrc)

but a) I think that violates the spirit of tea, and b) we'd probably want to reject it.

@mxcl mxcl added the question Further information is requested label Jun 7, 2023
@mxcl mxcl changed the title Refer to $HOME Support post-install? Jan 7, 2024
@jhheider jhheider transferred this issue from pkgxdev/pantry Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants