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

cached Z_DATA path not portable #104

Open
ckoehler opened this issue Jul 14, 2021 · 4 comments
Open

cached Z_DATA path not portable #104

ckoehler opened this issue Jul 14, 2021 · 4 comments

Comments

@ckoehler
Copy link

Sorry if this is not a z issue, but a fish thing. I am new to both.

In z.fish, it sets Z_DATA and some other vars that include the $HOME directory. Unfortunately, $HOME is different for me on different machines, so I get errors when Z_DATA points to the data path of another machine.

Any way to fix that? Is it a fish thing? Thanks!

@markstos
Copy link

markstos commented Apr 5, 2022

I think you are referring to setting some universal variables, which get written to ~/.config/fish_variables, like this:

SETUVAR Z_DATA:/home/mark/\x2elocal/share/z/data
SETUVAR Z_DATA_DIR:/home/mark/\x2elocal/share/z

The code says it only sets those universal variables of Z_DATA is not set. It uses if test -z "$Z_DATA". According to man test, this is checking if Z_DATA is zero-length or not.

https://github.com/jethrokuan/z/blob/master/conf.d/z.fish

So the solution is set Z_DATA on both of your machines with different values.

The document already recommends setting Z_DATA explicily: https://github.com/jethrokuan/z/blob/master/man/man1/z.md#configuration)https://github.com/jethrokuan/z/blob/master/man/man1/z.md#configuration

@lorthirk
Copy link

lorthirk commented Jul 4, 2022

Uhm... this means we should set Z_DATA explicitly to the home path value in every machine... something that should be the default actually. Doesn't sound very clean.

Also, I can't see where the documentation "recommends" to set Z_DATA explicitly -- perhaps it has been edited in the meanwhile?

For reference, Fisher itself fixed this very issue here, so IMHO a similar approach could be considered.

@itsfarseen
Copy link

Here's my workaround for this: https://github.com/itsfarseen/dotfiles/blob/3df373b321e8f240eaba169611bfe9adab86c514/config/fish/conf.d/_z-make-portable.fish

More context:
jorgebucaran/fisher#746

@markstos
Copy link

I think this issue can be closed. Multiple comments have documented solutions that don't require modifying the code here.

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

4 participants