Skip to content

Commit feefbc4

Browse files
committed
Improve pj.fish for nested repositories
1 parent fd4451e commit feefbc4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • symlinks/config/fish/functions

symlinks/config/fish/functions/pj.fish

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
function pj -d "Search projects directory and navigate to selected project"
55
set -f projects_path "$HOME/src"
66
if count $argv >/dev/null
7-
set -f repo_path (find "$projects_path" -mindepth 3 -maxdepth 3 -type d | awk -F "$projects_path" '{print $2}' | fzf --query="$argv" -1 | head -n 1)
7+
set -f repo_path (find "$projects_path" -mindepth 3 -maxdepth 6 -type d -execdir test -d {}/.git ';' -print -prune | awk -F "$projects_path" '{print $2}' | fzf --query="$argv" -1 | head -n 1)
88
else
9-
set -f repo_path (find "$projects_path" -mindepth 3 -maxdepth 3 -type d | awk -F "$projects_path" '{print $2}' | fzf)
9+
set -f repo_path (find "$projects_path" -mindepth 3 -maxdepth 6 -type d -execdir test -d {}/.git ';' -print -prune | awk -F "$projects_path" '{print $2}' | fzf)
1010
end
1111

1212
if test -n "$repo_path"

0 commit comments

Comments
 (0)