-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup
executable file
·50 lines (43 loc) · 1.62 KB
/
setup
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
#set -e
debug='> /dev/null 2>&1'
echo "----- getting theme Flex files -----"
eval "git clone https://github.com/alexandrevicenzi/Flex.git Flex $debug"
piprepo="0"
while [[ $piprepo = "0" ]];do
read -p "Are you located in China mainland?" yn
case $yn in
[Nn]* ) piprepo="";;
[Yy]* ) piprepo="-i https://pypi.doubanio.com/simple";;
* ) echo "Please answer yes or no.";;
esac
done
echo "----- installing dependencies -----"
eval "pip install virtualenv $piprepo $debug"
eval "virtualenv -p python3 --no-site-packages $PWD $debug"
source $PWD/bin/activate
eval "pip install pelican markdown ghp-import six $piprepo $debug"
mkdir -p $PWD/content
echo "----- doing some basic setting for your website -----"
echo -n "What is your github user name? "
read github
echo -n "What is the default author name? "
read author
echo -n "What is your website name"
read sitename
echo -n "What is your website description"
read description
config_file="$PWD/pelicanconf.py"
echo "----- setting up your website -----"
cp $PWD/pelicanconf.temp.py $PWD/pelicanconf.py
sed -i -e "s/%github%/$github/g" $config_file
sed -i -e "s/%author%/$author/g" $config_file
sed -i -e "s/%sitename%/$sitename/g" $config_file
sed -i -e "s/%description%/$description/g" $config_file
rm pelicanconf.py-e
echo "----- doing the first time publish -----"
eval "bash $PWD/publish $debug"
echo "setup process finished"
echo "you can visit http://"$github".github.io to to check your website"
echo "the default theme is Flex for pelcan, you can find more configurations here"
echo "https://github.com/alexandrevicenzi/Flex/wiki"
echo "enjoy your writing~~"