新建文稿

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
cd ~/Hexo/source/_posts

num="0"
for file in *
do
filename="${file%.*}"
if [ "$filename" -gt "$num" ]
then
num=$filename
fi
done
num=$[$num+1]

hexo new $num
open ./$num.md

exit

部署上传

1
2
3
4
5
6
7
8
9
cd ~/Hexo

#hexo clean
#hexo g -d
git add .
git commit -m "new report"
git push

exit

Alfred 执行命令行代码

脚本地址