Update 2024-02-14 07:51 OpenBSD/amd64-x13
This commit is contained in:
33
.bin/OLD/eg
Executable file
33
.bin/OLD/eg
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
. $HOME/.bin/_config
|
||||
|
||||
# build list...
|
||||
build_list() {
|
||||
L=$( ssh $USER@$DOMAIN \
|
||||
"find \"$LOCAL_PATH\" \
|
||||
! -path '*/hn/*' \
|
||||
! -path '*/git/*' \
|
||||
! -path '*/p/*' \
|
||||
-type f \
|
||||
\( -name '*.gph' \
|
||||
-o -name '*.dcgi' \
|
||||
-o -name '*.txt' \
|
||||
-o -name '*.sh' \
|
||||
\) \
|
||||
| cut -b "$(( ${#LOCAL_PATH} + 2))- \
|
||||
| sort -hr )
|
||||
}
|
||||
build_list
|
||||
|
||||
# edit loop
|
||||
while true;
|
||||
do
|
||||
S=$( printf '%s' "$L" | fzf --no-sort )
|
||||
[ "$?" -eq "130" ] && exit # fzf return 130 on ctrl+c
|
||||
[ -z "$S" ] && continue
|
||||
A="$( printf '%s\n%s' "EDIT" "DELETE" | fzf --no-sort )"
|
||||
case $A in
|
||||
EDIT) vim "scp://$USER@$DOMAIN/$LOCAL_PATH/$S"; ;;
|
||||
DELETE) ssh $USER@$DOMAIN "rm $LOCAL_PATH/$S"; build_list; ;;
|
||||
esac
|
||||
done
|
||||
Reference in New Issue
Block a user