From 1dece36fd7e315aee98f1c06d7064fbd6ef877e8 Mon Sep 17 00:00:00 2001 From: garhve Date: Mon, 26 Dec 2022 16:39:49 +0800 Subject: add list function --- bash/blog.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bash') diff --git a/bash/blog.sh b/bash/blog.sh index f6abe18..98be50b 100755 --- a/bash/blog.sh +++ b/bash/blog.sh @@ -8,7 +8,7 @@ # @description : simplify blog publishing, it only can use in blog dir ###################################################################### -# usage: prog new/edit/push [en/cn] +# usage: prog funct [en/cn] push() { read -r -p "Do you want to push?[y/n] " ans @@ -71,9 +71,19 @@ new() { echo -e "\nall done" } +list() { + echo -e "List \x1b[1;34mEN\x1b[0m content:" + tree ./content/en/posts + echo -e "List \x1b[1;33mCN\x1b[0m content:" + tree ./content/cn/posts +} + + +funct="new/edit/push/ls" -[ $# -lt 1 ] && echo "usage: $(basename $0) new/edit/push [en/cn]" +[ $# -lt 1 ] && echo "usage: $(basename $0) $funct [en/cn]" [ $1 == "new" ] && new "$2" [ $1 == "edit" ] && edit "$2" [ $1 == "push" ] && push +[ $1 == "ls" ] && list -- cgit v1.2.3-70-g09d2