mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 22:22:40 +00:00
Updated tmux-sessionator
This commit is contained in:
@@ -28,9 +28,6 @@ function path_prepend() {
|
|||||||
# Check that arg is a directory but not a symlink
|
# Check that arg is a directory but not a symlink
|
||||||
# Bc on some of my machines ~/projects is a symlink to $REPOS
|
# Bc on some of my machines ~/projects is a symlink to $REPOS
|
||||||
test -d $arg && ! test -L $arg || continue
|
test -d $arg && ! test -L $arg || continue
|
||||||
paths=${paths//$arg}
|
|
||||||
paths=${paths/#$arg}
|
|
||||||
paths=${paths/%$arg}
|
|
||||||
paths=($arg $paths)
|
paths=($arg $paths)
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -39,7 +36,7 @@ function setup_fuzzy_find_paths() {
|
|||||||
path_prepend "$HOME" \
|
path_prepend "$HOME" \
|
||||||
"$HOME/projects" \
|
"$HOME/projects" \
|
||||||
"$REPOS/local" \
|
"$REPOS/local" \
|
||||||
$(find "$REPOS/github.com" -mindepth 1 -maxdepth 1 -type d -print 2> /dev/null)
|
$(find $REPOS/github.com -mindepth 1 -maxdepth 1 -type d -print 2> /dev/null)
|
||||||
}
|
}
|
||||||
|
|
||||||
#################### MAIN ####################
|
#################### MAIN ####################
|
||||||
@@ -57,14 +54,14 @@ elif [[ "$#" -eq 1 ]]; then
|
|||||||
selected=$1
|
selected=$1
|
||||||
else
|
else
|
||||||
setup_fuzzy_find_paths
|
setup_fuzzy_find_paths
|
||||||
debug_print "fuzzy find paths: $paths"
|
debug_print "fuzzy find paths: ${(@)paths}"
|
||||||
|
|
||||||
if [ -n "$DEBUG" ]; then
|
if [ -n "$DEBUG" ]; then
|
||||||
debug_print "Exiting because in debug mode."
|
debug_print "Exiting because in debug mode."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
selected=$(find "${(@)paths}" -mindepth 1 -maxdepth 1 -type d | fzf)
|
selected=$(find ${(@)paths} -mindepth 1 -maxdepth 1 -type d | fzf)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $selected ]]; then
|
if [[ -z $selected ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user