From fd6b1f4a7548c022856eb4d8bdeb076ad20d076b Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 3 May 2024 23:38:32 +0100 Subject: [PATCH] Simplify code repository directory structure --- bin/t | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/bin/t b/bin/t index 8196029..4e26984 100755 --- a/bin/t +++ b/bin/t @@ -11,29 +11,19 @@ else # Get the session name from fuzzy-finding list of directories and generating a # tmux-safe version. - # 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. - # TODO: only do this if the ~/Code/tmp directory exists. - items+=" " - items+=$(find "${HOME}/Code/tmp" \ - -maxdepth 1 \ + items=$(find "${HOME}/Code" \ + -maxdepth 2 \ -mindepth 1 \ -type d \ ! -name "*-old" \ ! -name "*.old" ) + if [[ -d "${HOME}/Documents/wiki" ]]; then + items+=" " + items+="${HOME}/Documents/wiki" + fi + selected=$(echo "${items}" | tr ' ' "\n" | sort | fzf --reverse) fi