add interactive clean alias

This commit is contained in:
James Dixon 2025-03-16 02:26:30 -04:00
parent f3c32f21b8
commit 0e31f2d7b5
2 changed files with 4 additions and 6 deletions

View File

@ -5,8 +5,7 @@
# Relies on BLOG_DIR to be set from environment # Relies on BLOG_DIR to be set from environment
hu() { hu() {
cd "$BLOG_DIR" echo "$BLOG_DIR"
if [ "$1" == "np" ]; then if [ "$1" == "np" ]; then
POST_NAME="$2" POST_NAME="$2"
if [ -z "$POST_NAME" ]; then if [ -z "$POST_NAME" ]; then
@ -20,14 +19,12 @@ hu() {
fi fi
if [ "$1" == "ls" ]; then if [ "$1" == "ls" ]; then
cd "$BLOG_DIR" && hugo list all | sed 1d | awk -F',' '{print $1, $(NF-4)}' | column -t hugo list all -s "$BLOG_DIR" | sed 1d | awk -F',' '{print $1, $(NF-4)}' | column -t
fi fi
if [ "$1" == "fzf" ]; then if [ "$1" == "fzf" ]; then
cd "$BLOG_DIR" && hugo list all | sed 1d | awk -F',' '{print $1, $(NF-4)}' | column -t | fzf | awk '{print $1}' hugo list all -s "$BLOG_DIR" | sed 1d | awk -F',' '{print $1, $(NF-4)}' | column -t | fzf | awk '{print $1}'
fi fi
$SHELL
} }
hu "$@" hu "$@"

View File

@ -32,6 +32,7 @@
cam = commit -am cam = commit -am
co = checkout co = checkout
cob = checkout -b cob = checkout -b
cl = clean -i
br = branch br = branch
d = diff d = diff
df = diff df = diff