-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkohana-git-init-workingtree.sh
executable file
·64 lines (53 loc) · 1.81 KB
/
kohana-git-init-workingtree.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
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
#autor: [email protected]
#desc: Bootstrap a kohana 3.3 working directory from GITHUB
#date: v1 2014/03/05
#
#Tested on FreeBSD 10.0
#http://kohanaframework.org/3.3/guide/kohana/tutorials/git
KO_VERSION="3.3"
if [ ! -d .git ]; then
echo "[INFO] Creation of GIT repo"
git init
else
echo "[INFO] It's a GIT repo"
fi
#
#Get Koahana base
#
git submodule add git://github.com/kohana/core.git system
git submodule init
git commit -m 'Added initial system directory'
#
#Module - https://github.com/kohana/kohana/tree/3.3/master/modules
#Available modules: auth cache codebench database image minion orm unittest userguide
#
set -- auth cache codebench database image minion orm unittest userguide
while [ $# -gt 0 ]
do
git submodule add git://github.com/kohana/$1\.git modules/$1
echo $1
shift;
done
git submodule init
git commit -m 'Added wished modules'
#
#Create the working tree
#
mkdir -p application/classes/{Controller,Model}
mkdir -p application/{config,views}
mkdir -p application/{cache,logs}
touch application/classes/{Controller,Model}/.gitignore
touch application/{config,views}/.gitignore
touch application/{cache,logs}/.gitignore
#fetching the index.php and the bootstrap.php
if [ `uname` = "FreeBSD" ] ;then
fetch https://github.com/kohana/kohana/raw/"$KO_VERSION"/master/index.php
fetch -o application/bootstrap.php https://github.com/kohana/kohana/raw/"$KO_VERSION"/master/application/bootstrap.php
else
wget https://github.com/kohana/kohana/raw/"$KO_VERSION"/master/index.php --no-check-certificate
wget https://github.com/kohana/kohana/raw/"$KO_VERSION"/master/application/bootstrap.php --no-check-certificate -O application/bootstrap.php
fi
git add application/ index.php
git commit -m 'Added initial directory structure'
echo "[INFO]Please remove $0"