-
Notifications
You must be signed in to change notification settings - Fork 5
/
make.sh
executable file
·43 lines (42 loc) · 1.02 KB
/
make.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
#!/bin/bash
itemName="$2"
itemDate=`date +'%Y-%m-%d'`;
itemFile="_posts/$itemDate-$itemName.md";
case "$1" in
sparkle)
echo "---" > $itemFile;
echo "layout : sparkle" >> $itemFile;
echo "Enter sparkle title";
read itemTitle
echo "title : \"$itemTitle\"" >> $itemFile;
echo "Enter sparkle summary : "
read itemSummary
if [ "$itemSummary" != "" ]; then
echo "summary : \"$itemSummary\"" >> $itemFile;
fi
echo "Do you have a logo or thumbnail ? (y/n) : ";
read hasImage;
if [ "$hasImage" == "y" ]; then
echo "thumbnail : \"$itemName.jpg\"" >> $itemFile;
fi
echo "Enter sparkle URL : ";
read itemUrl;
if [ "$itemUrl" != "" ]; then
echo "visit : $itemUrl" >> $itemFile;
fi
echo "Enter sparkle tags : ";
read itemTags;
if [ "$itemTags" != "" ]; then
echo "tags : [$itemTags]" >> $itemFile;
fi
echo "Enter sparkle category : ";
read itemCategory;
if [ "$itemCategory" != "" ]; then
echo "category : \"$itemCategory\"" >> $itemFile;
fi
echo "---" >> $itemFile;
;;
help)
echo "./make.sh sparkle sparkle";
;;
esac