This repository has been archived by the owner on Jun 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpwprepare
69 lines (53 loc) · 1.8 KB
/
pwprepare
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
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Version 2.0
INPUT=$1
if [[ -z $INPUT ]]; then
INPUT="wwwroot"
printf "Directory option not set, installing into ./$INPUT/...\n"
else
printf "Installing in to ./$INPUT/...\n"
fi
# Select a version
printf "\nWhich ProcessWire branch do you want to install?\n"
options=("master" "dev" "devns")
select BRANCH in "${options[@]}"; do test -n "$BRANCH" && break; echo ">>> Invalid selection, please try again"; done
printf "\nDownloading ProcessWire $BRANCH branch, please hold on...\n"
# Get ProcessWire master and prepare files
if [ "$BRANCH" == "master" ]; then
curl -o processwire.zip https://github.com/ryancramerdesign/ProcessWire/archive/master.zip -# -L
fi
if [ "$BRANCH" == "dev" ]; then
curl -o processwire.zip https://github.com/ryancramerdesign/ProcessWire/archive/dev.zip -# -L
fi
if [ "$BRANCH" == "devns" ]; then
curl -o processwire.zip https://github.com/ryancramerdesign/ProcessWire/archive/devns.zip -# -L
fi
unzip -q processwire.zip
rm processwire.zip
if [ "$BRANCH" == "master" ]; then
mv ProcessWire-master $INPUT
fi
if [ "$BRANCH" == "dev" ]; then
mv ProcessWire-dev $INPUT
fi
if [ "$BRANCH" == "devns" ]; then
mv ProcessWire-devns $INPUT
fi
chmod -R u+rwX,go+rX,go-w $INPUT
mv $INPUT/htaccess.txt $INPUT/.htaccess
cd $INPUT
# Prompt for site profile
printf "\nWhich site profile will you be using?\n"
select d in site-*/; do test -n "$d" && break; echo ">>> Invalid selection, please try again"; done
mv $d site/
rm -rf site-*/
# Set permissions
chmod 777 site/assets
chmod 777 site/modules
chmod 666 site/config.php
printf "\n"
read -p "Press [Enter] once you've finished the installation process to remove the install files..."
rm install.php
rm -rf site/install
printf "\nInstallation files removed.\n"
printf "\nDirectory \"$INPUT\" all set for ProcessWire. Have fun! \n"