Skip to content

Commit

Permalink
Check if in a lein project before ns completion
Browse files Browse the repository at this point in the history
  • Loading branch information
jgdavey committed Aug 18, 2014
1 parent 8c990e5 commit 2f25510
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zsh_completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ _lein_plugin() {


_lein_namespaces() {
_values "lein valid namespaces" \
$(find "$1" -type f -name "*.clj" -exec awk '/^\(ns */ {gsub("\\)", "", $2); print $2}' '{}' '+')
if [ -f "./project.clj" -a -d "$1" ]; then
_values "lein valid namespaces" \
$(find "$1" -type f -name "*.clj" -exec awk '/^\(ns */ {gsub("\\)", "", $2); print $2}' '{}' '+')
fi
}


_lein_run() {
_lein_namespaces "src/"
}
Expand Down

0 comments on commit 2f25510

Please sign in to comment.