diff --git a/zsh/gclone.zsh b/zsh/gclone.zsh index 8cad278..653a3f5 100644 --- a/zsh/gclone.zsh +++ b/zsh/gclone.zsh @@ -102,9 +102,11 @@ if [ -d "$GCLONE_PATH" ]; then compdef _cdg cdg _cdg_refresh_cache() { + tmpfile=`mktemp` find $GCLONE_PATH -maxdepth 3 \ -not -name ".cdgcache" \ - -not -name "git" | sort > $GCLONE_PATH/.cdgcache + -not -name "git" | sort > $tmpfile + mv $tmpfile $GCLONE_PATH/.cdgcache } _cdg_existing_dirs() {