forked from tedkulp/silk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautogen.sh
51 lines (42 loc) · 1.33 KB
/
autogen.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
echo 'Setting up typical Silk Framework application directory structure and proper permissions...';
mkdir -p tmp
mkdir -p tmp/templates_c
mkdir -p tmp/cache
mkdir -p tmp/configs
mkdir -p tmp/templates
chmod -R 777 tmp
mkdir -p config
mkdir -p components
mkdir -p components/app
mkdir -p components/app/models
mkdir -p components/app/controllers
mkdir -p components/app/views
mkdir -p layouts
mkdir -p log
chmod -R 777 log
cp lib/silk/index.php .
cp lib/silk/.htaccess .
# keep a single backup of old config if it happens to already exist
if [ -f config/setup.yml ]; then
# check if the files differ
cmp -s lib/silk/config/setup.yml config/setup.yml;
if [ $? == 1 ]; then
echo -e "\nThe file config/setup.yml exists and has changed. Do you want to backup this file before replacing? Y/N"
read backup_setup;
case $backup_setup in
[yY]*)
mv config/setup.yml config/setup.yml.backup;
echo 'File config/setup.yml copied to setup.yml.backup';
echo 'File default setup.yml written to config/setup.yml.';
echo 'You might want to "diff config/setup.yml config/setup.yml.backup" before reverting to your old setup.';
break;;
*)
echo 'File config/setup.yml overwritten. Old setup.yml not backed up.';
break;;
esac
fi
fi
cp lib/silk/config/setup.yml config/;
cp lib/silk/config/routes.php config/
echo -e "\nDONE";