2023-10-08 13:33:57 +02:00
|
|
|
#!/usr/bin/env fish
|
2023-10-04 15:02:27 +02:00
|
|
|
set pipe (mktemp --dry-run)
|
|
|
|
mkfifo $pipe
|
|
|
|
|
2023-10-08 13:33:57 +02:00
|
|
|
fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec-batch dirname {} | tee $pipe >/dev/null &
|
|
|
|
fd . ~/ --min-depth 1 --max-depth 3 --type d --exec-batch realpath {} | tee $pipe >/dev/null &
|
|
|
|
set selected (cat $pipe | awk '!seen[$0]++' | fzf --query "$argv")
|
2023-10-04 15:02:27 +02:00
|
|
|
rm -f "$pipe"
|
2023-07-04 11:44:55 +02:00
|
|
|
|
|
|
|
set selected_name (basename $selected 2>/dev/null | string replace "." "_")
|
|
|
|
|
|
|
|
if not test -n "$selected_name"
|
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
|
2023-10-27 09:00:02 +02:00
|
|
|
tn "$selected_name" "$selected"
|