Permalink
Browse files

fix load_smartcd sourced detection in zsh

  • Loading branch information...
cxreg committed Aug 31, 2014
1 parent e028d3c commit c8356e92a967f90c17ef0f5bc8bef6fa06605185
Showing with 14 additions and 5 deletions.
  1. +14 −5 load_smartcd
View
@@ -1,10 +1,19 @@
#!/bin/bash
if [[ $0 =~ load_smartcd ]]; then
echo "This cannot be run as a command, please run"
echo
echo " source load_smartcd"
exit 1
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

0 comments on commit c8356e9

Please sign in to comment.