Simplify code repository directory structure
This commit is contained in:
parent
58e7ca413b
commit
fd6b1f4a75
24
bin/t
24
bin/t
|
@ -11,29 +11,19 @@ else
|
||||||
# Get the session name from fuzzy-finding list of directories and generating a
|
# Get the session name from fuzzy-finding list of directories and generating a
|
||||||
# tmux-safe version.
|
# tmux-safe version.
|
||||||
|
|
||||||
# Find all project directories within ~/Code, ignoring ~/Code/tmp as those
|
items=$(find "${HOME}/Code" \
|
||||||
# are only at a single level and I don't want sub-directories within those
|
-maxdepth 2 \
|
||||||
# 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.
|
|
||||||
# TODO: only do this if the ~/Code/tmp directory exists.
|
|
||||||
items+=" "
|
|
||||||
items+=$(find "${HOME}/Code/tmp" \
|
|
||||||
-maxdepth 1 \
|
|
||||||
-mindepth 1 \
|
-mindepth 1 \
|
||||||
-type d \
|
-type d \
|
||||||
! -name "*-old" \
|
! -name "*-old" \
|
||||||
! -name "*.old"
|
! -name "*.old"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if [[ -d "${HOME}/Documents/wiki" ]]; then
|
||||||
|
items+=" "
|
||||||
|
items+="${HOME}/Documents/wiki"
|
||||||
|
fi
|
||||||
|
|
||||||
selected=$(echo "${items}" | tr ' ' "\n" | sort | fzf --reverse)
|
selected=$(echo "${items}" | tr ' ' "\n" | sort | fzf --reverse)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue