-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomake.sh
executable file
·50 lines (42 loc) · 1.02 KB
/
automake.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bash/sh
markdown_dir="markdown"
markdown_folder=""
author=""
github_homepage=""
file_path=""
title=""
function install() {
cnpm install
}
function MakeOwnFolder() {
cd $markdown_dir
echo "请输入你的Markdown文件名。如:PWA/PS等(必填)"
read markdown_folder
mkdir $markdown_folder
cd $markdown_folder
touch $markdown_folder.md
file_path=${markdown_folder}"/"${markdown_folder}".md"
mkdir asset
}
function GetInfo() {
echo "请输入你的中文姓名:如王小明(必填)"
read author
echo "请输入你的github主页:"
read github_homepage
echo "请输入你的页面title:如PS分享(必填)"
read title
}
function SetInfo() {
cd "../../"
jq '{"list":[[.list[]] + [{"author":"'$author'","homepage":"'$github_homepage'","path":"'$file_path'","title":"'$title'"}]][0]}' menu.json > menu1.json
mv menu.json
mv menu1.json menu.json
}
function Run() {
install
MakeOwnFolder
GetInfo
SetInfo
npm start -- --port=8002
}
Run