dotfiles/.bin/dev-dirs

19 lines
579 B
Plaintext
Raw Normal View History

2023-02-22 08:31:38 +01:00
#!/bin/sh
cd /usr/ports
[ ! -z "$1" ] && EXTRA="-q $1"
_ports=$(echo "SELECT PkgPath from Paths;" \
| sqlite3 /usr/local/share/sqlports \
| sort -u | sed 's,^,/usr/ports/,g')
2023-02-22 08:31:38 +01:00
2023-03-06 08:14:38 +01:00
_list=$(find /usr/ports/mystuff/*/* /usr/src/*/* /usr/xenocara/*/* /usr/src /usr/xenocara /usr/ports -type d -maxdepth 0)
2023-02-22 08:31:38 +01:00
print "$_ports\n$_list\n/usr/src\n/usr/ports\n/usr/www\n/usr/xenocara" \
2023-02-22 08:31:38 +01:00
| grep -v "/CVS" \
| while IFS= read -r l; do echo "${#l} $((++n)) $l"; done \
| sort -un \
2023-02-22 08:31:38 +01:00
| cut -d" " -f3- \
| fzf $EXTRA -e -i -0 -1 +s --preview "tree {1}"