-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
59 lines (58 loc) · 1.18 KB
/
run
File metadata and controls
59 lines (58 loc) · 1.18 KB
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
51
52
53
54
55
56
57
58
59
#!/bin/bash
while getopts '?dh:' OPTION; do
case "$OPTION" in
h)
clear
value="$OPTARG"
case $value in
n)
path="${@: -2}"
src="${path// //}"
hugo new content/$src.md
;;
S-wd)
hugo server -w -D; exit 0
;;
S-w)
hugo server -w; exit 0
;;
S-d)
hugo server -D; exit 0
;;
S)
hugo server; exit 0
;;
*)
echo "error: argument not found"
;;
esac
exit 0
;;
d)
clear
echo -e "\033[0;32mDeploying to GitHub...\033[0m"
echo "Enter commit message :"
read msg
d=`date '+%FT%T.%3N+0700Z'`
git add -A
if [ -z "$msg" ]
then
git commit -m "[$d]"
else
git commit -m "[$d]: $msg"
fi
git push -u origin main
exit 0
;;
?)
echo -e "[-d] \t\t Upload this project into github repository" >&2
echo -e "[-h argument] \t Run hugo command with a simple steps" >&2
exit 0
;;
*)
echo "usage: [-d] [-h argument]" >&2
exit 1
;;
esac
done
shift "$(($OPTIND -1))"