oh-my-fish / plugin-z

Integration with z (autojump alternative).
MIT License
64 stars 11 forks source link

Latest commit broke plugin #12

Open lukasmalkmus opened 7 years ago

lukasmalkmus commented 7 years ago

Hi, your latest commit broke z for me. fish 2.6.0 bash 4.4.12 z 1.9 I installed z (this plugin) with omf.

Running z in fish returns:

bash: line 2: _z: command not found
cd: The directory 'bash: line 1: /Users/lukasmalkmus/.local/share/omf/pkg/z/functions/../z/z.sh: No such file or directory' does not exist

Runningcd returns:

bash: line 2: _z: command not found
cd: The directory 'bash: line 1: /Users/lukasmalkmus/.local/share/omf/pkg/z/functions/../z/z.sh: No such file or directory' does not exist
~/.local/share/omf/pkg/z/functions/z.fish (line 16): 
    builtin cd $Z_PWD
    ^
in function 'z'
        called on line 5 of file ~/.local/share/omf/pkg/z/init.fish
        with parameter list '--add /Users/lukasmalkmus/Code'

in function 'z.pwd'
        called on line 5 of file /usr/local/Cellar/fish/2.6.0/share/fish/functions/cd.fish
        with parameter list 'VARIABLE SET PWD'

in event handler: handler for variable 'PWD'
sagebind commented 7 years ago

What version of OMF do you have? (omf --version)?

Latest commit refactored the plugin to bundle z with the plugin. It uses git submodules, so I'm thinking that the submodule did not get cloned for some reason. Older versions of OMF would not have done that step also.

lukasmalkmus commented 7 years ago

Oh My Fish version 5

sagebind commented 7 years ago

I just tried a fresh install in an empty environment and it worked for me. So there must be some condition causing this problem.

The following should fix the problem, but I'm not 100% sure what would have caused it:

omf cd z
git submodule init
git submodule update
lukasmalkmus commented 7 years ago

Oh, I fucked up. I had z installed via brew. So removing z (brew) and then reinstalling your plugin worked fine. Might be worth a note in the README!

sagebind commented 7 years ago

Actually, I don't think it was your fault. I just reproduced it somehow in OS X without having z installed already.

It's like its trying to use z on cd before its even finished installing it. I'm not sure what is causing the plugin to load before it is done installing though.

sotaan commented 7 years ago

I have the same problem on Debian Jessie with last version of omf and fish installed. When I did your workaround, it worked despite the output I got just before after installing the plugin :

 ~ >  omf install z                                                                                                       
Updating https://github.com/oh-my-fish/packages-main master... Done!
Installing package z
Submodule 'z' (https://github.com/rupa/z) registered for path 'z'
Cloning into 'z'...
remote: Counting objects: 726, done.
remote: Total 726 (delta 0), reused 0 (delta 0), pack-reused 726
Receiving objects: 100% (726/726), 140.54 KiB | 0 bytes/s, done.
Resolving deltas: 100% (320/320), done.
Checking connectivity... done.
Submodule path 'z': checked out '3eb64444d713b9fc6c9ad1a8fc8814639c584faa'
✔ z successfully installed.
iamcco commented 5 years ago

same issue