-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake
43 lines (35 loc) · 995 Bytes
/
make
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
#!/usr/bin/env bash
Option=$1
Login=$( python3 ./app/get-data.py login )
Host=$( python3 ./app/get-data.py host )
Port="5000"
function Backup () {
topath="$HOME/Downloads"
cd ./_site && cp -r ./* $topath
}
function RunServe () {
if [ -d ./.jekyll-cache ]; then
echo "$Login" | sudo -S rm -R ./.jekyll-cache
fi
for filename in .jekyll-metadata Gemfile.lock
do
if [ -f ./$filename ]; then
echo "$Login" | sudo -S rm ./$filename
fi
done
bundle exec jekyll serve -l -H --trace --incremental [ --host $Host --port $Port ]
}
function RunBuild () {
Login=$( head $HOME/login )
echo "$Login" | sudo -S bundle exec jekyll build --trace --incremental JEKYLL_ENV=development
}
function RunApp () {
cd ./app && source ./venv/bin/activate && python3 app.py
}
if [[ $Option == "run-serve" ]]; then
(RunServe)
elif [[ $Option == "run-build" ]]; then
(RunBuild)
elif [[ $Option == "run-app" ]]; then
(RunApp)
fi