Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

__avn_chpwd:local:1: not valid in this context error #36

Open
apricot13 opened this issue Jan 14, 2016 · 9 comments
Open

__avn_chpwd:local:1: not valid in this context error #36

apricot13 opened this issue Jan 14, 2016 · 9 comments

Comments

@apricot13
Copy link

I've just switched to zsh and am getting the following error when I load a directory with a .node_version file in it

__avn_chpwd:local:1: not valid in this context: Theatre/national-theatre-pp/.node-version

I have this in my .zshrc file (copied over from my .bashrc)

eval "$(rbenv init -)"
[[ -s "$HOME/.avn/bin/avn.sh" ]] && source "$HOME/.avn/bin/avn.sh" # load avn

can anyone point me in the right direction?

@wbyoung
Copy link
Owner

wbyoung commented Jan 14, 2016

Can you try without the rbevn init to see if there's a conflict?

If no conflict, can you share what version of zsh, any addons, and on what OS you're running things?

@apricot13
Copy link
Author

Still no joy with rbenv commented out.

ZSH 5.1.1
OSX 10.10.4

no addons other than oh my zsh

@wbyoung
Copy link
Owner

wbyoung commented Jan 16, 2016

Ok, the issue was with whitespace in the path name. I've got a branch up that you should be able to install & test. I want to add test coverage to this before merging, but don't have time right now. Please test with:

npm i -g wbyoung/avn#zsh-whitespace-dir
avn setup

@apricot13
Copy link
Author

no joy I'm afraid. I tried with and without rbenv commented out.

My .node-version just contains '0.12.7' is that correct - I couldn't find any example .node-version files anywhere!

@wbyoung
Copy link
Owner

wbyoung commented Jan 20, 2016

@apricot13 yes, that's correct. The format is documented here. Can you please provide debugging output when using that branch?

@apricot13
Copy link
Author

using that branch the output is, I ran it before and after running nvm use 0.12.7 just in case!

hannahmacbook: ~/Projects/National Theatre/national-theatre-pp                                                                                                                                                    
→ __avn_debug
__avn_debug:local:1: not valid in this context: Theatre/national-theatre-pp/.node-version

Definitely doesn't like the spaces.

@wbyoung
Copy link
Owner

wbyoung commented Jan 30, 2016

@apricot13 sorry, I had the sequence of commands slightly wrong before (I didn't update the version number on the branch, so avn didn't actually upgrade itself):

npm i -g 'wbyoung/avn#zsh-whitespace-dir'
rm -r ~/.avn
avn setup

Now open a new shell, cd to the folder & see what happens. __avn_debug if it doesn't work again.

@apricot13
Copy link
Author

you ⭐, it works!

(also how do I get back to the main branch once your changes are merged in!?)

@wbyoung
Copy link
Owner

wbyoung commented Feb 1, 2016

@apricot13 once merged & released, it'll just be updating as usual.

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

No branches or pull requests

2 participants