cxreg/smartcd

"source" detection in load_smartcd does not work with zsh

blueyed opened this issue · 2 comments

c8356e9 was meant to fix it, but it does not work.

When sourcing it from zsh, I get:

% source load_smartcd
+load_smartcd:3> [[ -n 5.0.6-dev-0 ]]
+load_smartcd:4> [[ '' != load_smartcd ]]
+load_smartcd:5> echo 'This cannot be run as a command, please run'
This cannot be run as a command, please run
+load_smartcd:6> echo

+load_smartcd:7> echo '    source load_smartcd'
    source load_smartcd
+load_smartcd:8> exit 1

Maybe this was just taken from http://unix.stackexchange.com/a/73010/1920, or have you tested it?

milin commented

Try source $HOME/.smartcd/lib/core/smartcd. I was having a similar issue and that worked for me.

Thanks, @milin.

I've since moved (and written most of) https://github.com/Tarrasch/zsh-autoenv by now. It even uses parts of smartcd's ideas/lib.