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
hu() {
cd "$BLOG_DIR"
echo "$BLOG_DIR"
if [ "$1" == "np" ]; then
POST_NAME="$2"
if [ -z "$POST_NAME" ]; then
@ -20,14 +19,12 @@ hu() {
fi
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
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
$SHELL
}
hu "$@"

View File

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