diff options
Diffstat (limited to 'bash')
-rwxr-xr-x | bash/blog.sh | 14 |
1 files changed, 12 insertions, 2 deletions
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 |