Révision 4ed597de
Ajouté par Julien Enselme il y a plus de 10 ans
bin/d7-create-site.sh | ||
---|---|---|
7 | 7 |
help="# ARGS: site_name [--no-init-database]" |
8 | 8 |
|
9 | 9 |
# Check if site already exists. |
10 |
if `site_exists $d7_site_name` ; then
|
|
10 |
if site_exists $d7_site_name ; then
|
|
11 | 11 |
exit 1 |
12 | 12 |
fi |
13 | 13 |
|
14 |
init_db=0
|
|
14 |
init_db=1
|
|
15 | 15 |
if [ "$2" = "--no-init-database" ] ; then |
16 |
init_db=1
|
|
16 |
init_db=0
|
|
17 | 17 |
fi |
18 | 18 |
|
19 | 19 |
######## Exceptions |
20 | 20 |
check_arguments $# 1 "$help" |
21 | 21 |
|
22 | 22 |
echo "Checking if work tree is clean (may take a while)" |
23 |
if ! `work_tree_clean` ; then
|
|
23 |
if ! work_tree_clean ; then
|
|
24 | 24 |
echo "Your work tree is not clean. Solve this before $0 can continue." |
25 | 25 |
exit 2 |
26 | 26 |
fi |
bin/d7-sync-site.sh | ||
---|---|---|
15 | 15 |
. /users/guest/assos/bin/scripts-utils.sh |
16 | 16 |
|
17 | 17 |
# Create site if necessary |
18 |
if ! `site_exists $2` ; then
|
|
18 |
if ! site_exists $2 ; then
|
|
19 | 19 |
echo "$2 does not exit. We will create it" |
20 | 20 |
d7-create-site.sh $2 --no-init-database |
21 | 21 |
fi |
bin/scripts-utils.sh | ||
---|---|---|
104 | 104 |
# Check if site database exists. |
105 | 105 |
if mysql --defaults-extra-file=$myassos_cnf -e "USE $1" 2>/dev/null ; then |
106 | 106 |
echo "Database $1 already exits." |
107 |
return 1
|
|
107 |
return 0
|
|
108 | 108 |
fi |
109 | 109 |
|
110 | 110 |
# Check if site folder already exists. |
111 | 111 |
dir=$d7_dir_sites/$1 |
112 | 112 |
if [ -d "$dir" ] ; then |
113 | 113 |
echo "Foder $dir already exists." |
114 |
return 1
|
|
114 |
return 0
|
|
115 | 115 |
fi |
116 |
return 0
|
|
116 |
return 1
|
|
117 | 117 |
} |
Formats disponibles : Unified diff
Correct tests