mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +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
|
||||
# Bc on some of my machines ~/projects is a symlink to $REPOS
|
||||
test -d $arg && ! test -L $arg || continue
|
||||
paths=${paths//$arg}
|
||||
paths=${paths/#$arg}
|
||||
paths=${paths/%$arg}
|
||||
paths=($arg $paths)
|
||||
done
|
||||
}
|
||||
@@ -39,7 +36,7 @@ function setup_fuzzy_find_paths() {
|
||||
path_prepend "$HOME" \
|
||||
"$HOME/projects" \
|
||||
"$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 ####################
|
||||
@@ -57,14 +54,14 @@ elif [[ "$#" -eq 1 ]]; then
|
||||
selected=$1
|
||||
else
|
||||
setup_fuzzy_find_paths
|
||||
debug_print "fuzzy find paths: $paths"
|
||||
debug_print "fuzzy find paths: ${(@)paths}"
|
||||
|
||||
if [ -n "$DEBUG" ]; then
|
||||
debug_print "Exiting because in debug mode."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
selected=$(find "${(@)paths}" -mindepth 1 -maxdepth 1 -type d | fzf)
|
||||
selected=$(find ${(@)paths} -mindepth 1 -maxdepth 1 -type d | fzf)
|
||||
fi
|
||||
|
||||
if [[ -z $selected ]]; then
|
||||
|
||||
Reference in New Issue
Block a user