diff options
| author | garhve <git@garhve.com> | 2022-12-26 16:39:49 +0800 | 
|---|---|---|
| committer | garhve <git@garhve.com> | 2022-12-26 16:39:49 +0800 | 
| commit | 1dece36fd7e315aee98f1c06d7064fbd6ef877e8 (patch) | |
| tree | 0267b675601f9ebbd74b315cc62b90a7dbd7211b /bash/blog.sh | |
| parent | 36920adbaa85bd1be5ad37d7a22212231179930f (diff) | |
add list function
Diffstat (limited to 'bash/blog.sh')
| -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 | 
