Don't show any directories ending in "-old"
This commit is contained in:
parent
1d11adfe94
commit
3d24bce0d9
27
bin/t
27
bin/t
|
@ -10,11 +10,30 @@ if [[ $# -eq 1 ]]; then
|
|||
else
|
||||
# Get the session name from fuzzy-finding list of directories and generating a
|
||||
# tmux-safe version.
|
||||
items+=$(find "${HOME}/Code" -mindepth 3 -maxdepth 3 -type d ! -name .git -not -path "${HOME}/Code/tmp/*")
|
||||
items+=" "
|
||||
items+=$(find "${HOME}/Code/tmp" -mindepth 1 -maxdepth 1 -type d)
|
||||
|
||||
selected=$(echo "${items}" | sort | fzf --reverse)
|
||||
# Find all project directories within ~/Code, ignoring ~/Code/tmp as those
|
||||
# are only at a single level and I don't want sub-directories within those
|
||||
# directories to be shown.
|
||||
items+=$(find "${HOME}/Code" \
|
||||
-maxdepth 3 \
|
||||
-mindepth 3 \
|
||||
-type d \
|
||||
! -name "*-old" \
|
||||
! -name "*.old" \
|
||||
! -path "${HOME}/Code/tmp/*"
|
||||
)
|
||||
|
||||
# Add the top-level directories within ~/Code/tmp.
|
||||
items+=" "
|
||||
items+=$(find "${HOME}/Code/tmp" \
|
||||
-maxdepth 1 \
|
||||
-mindepth 1 \
|
||||
-type d \
|
||||
! -name "*-old" \
|
||||
! -name "*.old"
|
||||
)
|
||||
|
||||
selected=$(echo "${items}" | tr ' ' "\n" | sort | fzf --reverse)
|
||||
fi
|
||||
|
||||
if [[ -z "${selected}" ]]; then
|
||||
|
|
Loading…
Reference in a new issue