-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy.sh
35 lines (29 loc) · 809 Bytes
/
deploy.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
#!/bin/sh
site_address=1KiwiBCVBUcuypVm8FEmUW9YT6fJDXkN9r
local_path=$(dirname $(readlink -f $0))
data_path=~/Documents/ZeroNet/data
site_path="$data_path/$site_address"
zeronet_path="py -2 $(echo ~)/Documents/ZeroNet/zeronet.py"
pushd $local_path >/dev/null 2>&1
echo " ============= Deploy ============="
echo " Make sure all npm packages are "
echo " installed and webpack was ran. "
echo " =================================="
echo ""
read -p "Are you sure you want to start deploy? " -n 1 -r
echo
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
exit
fi
echo "Copying"
if [ -d $site_path/data ]; then
mv $site_path/data data-temp
fi
if ! [ -d $site_path ]; then
mkdir $site_path
fi
cp -r main/dist/* $site_path
if [ -d data-temp ]; then
rm -rf $site_path/data
mv data-temp $site_path/data
fi