Commit 650a012d8fbf575e8afba60c5d9c660be0733056
1 parent
de2937d3
Exists in
master
and in
1 other branch
update ok pour mac et linux (MACOS=0 ou 1)
Showing
1 changed file
with
12 additions
and
4 deletions
Show diff stats
install/update.sh
... | ... | @@ -14,6 +14,10 @@ |
14 | 14 | # (Bash Arrays : cf https://www.cyberciti.biz/faq/finding-bash-shell-array-length-elements/) |
15 | 15 | |
16 | 16 | |
17 | +# Version pour MacOS si MACOS=1 | |
18 | +MACOS=0 | |
19 | +#MACOS=1 | |
20 | + | |
17 | 21 | # Ne pas vider le fichier $ftpf (CLEAN=1 pour le vider) |
18 | 22 | CLEAN=0 |
19 | 23 | |
... | ... | @@ -73,6 +77,7 @@ echo |
73 | 77 | # TEST only |
74 | 78 | #[[ $TEST == 1 ]] && (rm ../database/update/test.txt ; rm ../database/update/db-update-2014-*.sh ; touch ../database/update/db-update-2014-08-23.sh) |
75 | 79 | if [[ $TEST == 1 ]] ; then |
80 | + MACOS=1 | |
76 | 81 | echo "(TEST MODE)" |
77 | 82 | echo "Suppression des fichiers de test créés précédemment (si besoin)" |
78 | 83 | (rm $db_update_scripts_folder/test.txt ; rm $db_update_scripts_folder/db-update-2014-*.sql ; touch $db_update_scripts_folder/db-update-2014-08-23.sql) |
... | ... | @@ -297,10 +302,13 @@ for db_update_script_new in ${db_update_scripts_new[@]} ; do |
297 | 302 | #echo "Suppression $db_update_script_new de $ftpf" |
298 | 303 | #echo "- avant suppr" |
299 | 304 | #cat ../../install/$ftpf |
300 | - # For Mac OS : | |
301 | - #sed -e "/$db_update_script_new/d" -i '' ../../install/$ftpf || abort | |
302 | - # For Linux : | |
303 | - sed -e "/$db_update_script_new/d" -i ../../install/$ftpf || abort | |
305 | + if [[ $MACOS == 1 ]] ; then | |
306 | + # For Mac OS : | |
307 | + sed -e "/$db_update_script_new/d" -i '' ../../install/$ftpf || abort | |
308 | + else | |
309 | + # For Linux : | |
310 | + sed -e "/$db_update_script_new/d" -i ../../install/$ftpf || abort | |
311 | + fi | |
304 | 312 | #echo "- après suppr" |
305 | 313 | #cat ../../install/$ftpf |
306 | 314 | done | ... | ... |