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 .zshenv #134

Closed
gonzus opened this issue Apr 30, 2023 · 11 comments · Fixed by #140
Closed

Support .zshenv #134

gonzus opened this issue Apr 30, 2023 · 11 comments · Fixed by #140
Assignees

Comments

@gonzus
Copy link

gonzus commented Apr 30, 2023

I don't have a ~/.zshrc file, I have a ~/.zshenv file with this in it:

export ZDOTDIR="$HOME/.config/zsh"

so that all my zsh configuration files live in ~/.config/zsh, including my .zshrc. Zap does not seem to support this setup.

@mamaraddio
Copy link
Member

I use the same setup and Zap works like a charm.

The problem here could be that your zshrc file haven't the . in front,
let me address it.

@mamaraddio mamaraddio self-assigned this May 2, 2023
@wintermi
Copy link
Contributor

wintermi commented May 2, 2023

I was looking through your dotfiles repos and do not see any issue which would cause Zap to fail. I did see a potential issue with the install script, though that could be easily fixed, but would not cause a failure.

@gonzus
Copy link
Author

gonzus commented May 2, 2023

Just to clarify, my dotfiles repo is probably not up to date.

My file does have the . to begin with:

$ cat .zshenv
export ZDOTDIR="$HOME/.config/zsh"
$ ls -al "$HOME/.config/zsh/"
total 2376
drwxr-xr-x  18 gonzo  staff   576B Apr 30 16:53 ./
drwxr-xr-x   4 gonzo  staff   128B Jan 26 11:13 ../
drwx------@  3 gonzo  staff    96B Jan  3 14:08 .zcompcache/
-rw-r--r--@  1 gonzo  staff    48K Mar 28 13:24 .zcompdump
-rw-------@  1 gonzo  staff   146B Apr  4 17:51 .zsh_history
drwx------   5 gonzo  staff   160B Apr  4 17:51 .zsh_sessions/
-rw-r--r--@  1 gonzo  staff   355B Dec  2 08:59 .zshrc
...
`

@wintermi
Copy link
Contributor

wintermi commented May 2, 2023

Was the issue experienced during the install or afterwards?

@mamaraddio
Copy link
Member

I recommend you to follow issue template for issues like that, anyway:

  • Please answer to the wintermi's question
  • Are you able to run zap version?
    • If yes, what the output of the previous command?
    • If not, are you able to source ~/.local/share/zap/zap.zsh

@gonzus
Copy link
Author

gonzus commented May 3, 2023

The install seems to happen correctly, but zap doesn't work afterwards:

$ zsh <(curl -s https://raw.githubusercontent.com/zap-zsh/zap/master/install.zsh) --branch release-v1
Zap is already installed in '/Users/gonzo/.local/share/zap'!
Reinstall Zap? [y/N] y
Reinstalling Zap...
Moved .zshrc to .zshrc_2023-05-03_1683119075

 Zapped
Find more plugins at http://zapzsh.org
⚡ Zap installed zsh-autosuggestions
⚡ Zap installed supercharge
⚡ Zap installed zap-prompt
⚡ Zap installed zsh-syntax-highlighting
⚡ 15:04 Wed 03/May gonzo@gonzo-mbp ~ 
$ 
⚡ 15:04 Wed 03/May gonzo@gonzo-mbp ~ 
$ zap version                                                                                        
fatal: No names found, cannot describe anything.
fatal: No names found, cannot describe anything.
⚡ Zap v
Branch:	release-v1
Commit:	

After installation, I can source ~/.local/share/zap/zap.zsh but zap version remains broken.

@mamaraddio
Copy link
Member

Please do a

rm -rf ~/.local/share/zap
zsh <(curl -s https://raw.githubusercontent.com/zap-zsh/zap/master/install.zsh)

This will completely uninstall Zap and reinstall it but without pinning it to the specific branch, there where many changes in last day.

Please try that version and let us know if it works

@wintermi
Copy link
Contributor

wintermi commented May 3, 2023

PR #138 rectifies the issue with zap version failing.

@gonzus
Copy link
Author

gonzus commented May 3, 2023

I tried that command, and got this error message:

$ rm -rf ~/.local/share/zap
$ zsh <(curl -s https://raw.githubusercontent.com/zap-zsh/zap/master/install.zsh)

Moved .zshrc to .zshrc_2023-05-03_1683134991
 Zapped
Find more plugins at http://zapzsh.org
:source:55: no such file or directory:

I think that hapenned because this line:

local ZSHRC="${ZDOTDIR:-$HOME}/.zshrc"

is inside function main(), but at the very end, outside function main(), the script tries to source "$ZSHRC", and at least in my case, that variable is empty. If I move the local declaration to right before the main() function, the script seems to work.

@wintermi
Copy link
Contributor

wintermi commented May 3, 2023

Please retest @gonzus and if you see any further issues please reopen.

@gonzus
Copy link
Author

gonzus commented May 4, 2023

All looking good, thanks!

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

Successfully merging a pull request may close this issue.

3 participants