qrush / sub

a delicious way to organize programs
http://37signals.com/svn/posts/3264-automating-with-convention-introducing-sub
MIT License
1.74k stars 148 forks source link

mysub:10: command not found: my sub #28

Closed cmalven closed 6 years ago

cmalven commented 11 years ago

My sub is called cmal and is installed at ~/Dropbox/Dropbox/Config/sub/cmal

My .zshenv contains:

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
eval "$($HOME/Dropbox/Config/sub/cmal/bin/cmal init -)"

Whenever I open a new terminal, and run cmal I get cmal:10: command not found: cmal

If I then run source ~/.zshenv followed by cmal I correctly get the usage.

But every time I open a new terminal window I'm back to square one. Any idea what could be going on?

qrush commented 11 years ago

Interesting! It looks like something is working though, since running cmal does work.

What does which cmal say?

cmalven commented 11 years ago

That's certainly the fastest I've ever had somebody respond to a GitHub issue! Thanks!

→ which cmal
cmal () {
    local command="$1"
    if [ "$#" -gt 0 ]
    then
        shift
    fi
    case "$command" in
        (shell) eval `cmal "sh-$command" "$@"` ;;
        (*) command cmal "$command" "$@" ;;
    esac
}
qrush commented 11 years ago

I bet it's not finding the sub on your $PATH...which should be happening on cmal init. For example, our sub 37 is installed in ~/.37. On my $PATH is:

/Users/qrush/.37/bin

...but 37 init (and cmal init) should handle that for you...what does your $PATH look like? Does it have that? (I bet it does after you run your source command)

cmalven commented 11 years ago

Before source:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

After source:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/cmalven/.rvm/bin:/Users/cmalven/Dropbox/Config/sub/cmal/bin
jeremy commented 6 years ago

Looks like #32