Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 28 lines (25 sloc) 790 Bytes
#!/bin/bash
if [[ -n $ZSH_VERSION ]]; then
if [[ $_ != $0 ]]; then
echo "This cannot be run as a command, please run"
echo
echo " source load_smartcd"
exit 1
fi
else
if [[ $0 =~ load_smartcd ]]; then
echo "This cannot be run as a command, please run"
echo
echo " source load_smartcd"
exit 1
fi
fi
# Just loading ~/.smartcd_config would be enough if it
# already exists, but for new installs it may not
if [[ -f $HOME/.smartcd/lib/core/smartcd ]]; then
# TODO: handle system-wide install?
source $HOME/.smartcd/lib/core/smartcd
[[ -f $HOME/.smartcd_config ]] && source $HOME/.smartcd_config
else
echo 'smartcd not installed yet! Run "make install" or follow the README instructions'
fi