-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·45 lines (35 loc) · 880 Bytes
/
init.sh
File metadata and controls
executable file
·45 lines (35 loc) · 880 Bytes
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
#!/usr/bin/env bash
echo "Please provide the site folder name:"
read SITE_NAME
if [ ! "$SITE_NAME" ]; then
echo "Site folder name is missing."
else
echo "Initializing site with name: $SITE_NAME"
if [ ! -d "shared" ]; then
mkdir shared
fi
cd shared
if [ ! -d "db" ]; then
mkdir db
fi
cd db
if [ ! -d .git ]; then
echo "Cloning sample database from GitHub"
git clone https://github.com/t3kit/t3kit_db.git .
fi;
cd ..
NUMBER_OF_SHARED_FOLDERS=`find ./* -maxdepth 0 -type d | wc -l`
if [ "$NUMBER_OF_SHARED_FOLDERS" == "2" ]; then
echo "Site folder already exists."
else
echo "Creating folder, cloning from repository and running composer install"
if [ ! -d "$SITE_NAME" ]; then
mkdir "$SITE_NAME"
fi
cd "$SITE_NAME"
if [ ! -d .git ]; then
git clone https://github.com/t3kit/t3kit_composer.git .
composer install
fi;
fi;
fi;