git-hacks

git-hacks Commit Details

Date:2014-04-05 10:12:38 (5 years 7 months ago)
Author:Nicola Fontana
Branch:master
Commit:b2818854d19027ccb0d4cfc446303405c48eea4e
Parents: 9e3072ad6e3edd8ae06cb3105994fcc8b4edf8ca
Message:gitdeploy: use $dir instead of $path

$path seems to be a reserved word and is cleared at least on bash
3.2.25 (default version on my CentOS 5 server).
Changes:
Mgitdeploy (3 diffs)

File differences

gitdeploy
6565
6666
6767
68
69
70
68
69
7170
7271
73
72
7473
7574
7675
......
8382
8483
8584
86
85
8786
8887
8988
......
9493
9594
9695
97
96
9897
9998
10099
}
refresh_silverstripe() {
local path="$1"
local code
local cfg type server username password database
local dir="$1"
local code cfg type server username password database
local php="
define('BASE_PATH', '$path');
define('BASE_PATH', '$dir');
define('FRAMEWORK_DIR', file_exists(BASE_PATH . '/framework') ? 'framework' : 'sapphire');
define('TEMP_FOLDER', '/tmp');
set_include_path(BASE_PATH . '/' . FRAMEWORK_DIR . PATH_SEPARATOR . get_include_path());
echo \"\$k='\$v'\n\";
}"
for cfg in "$path"/*/_config.php; do
for cfg in "$dir"/*/_config.php; do
code=$(php -r "$php" 2>/dev/null)
[ "$?" = "0" ] && eval "$code" && [ -n "$database" ] && break
done
mysqldump -h"$server" -u"$username" -p"$password" \
--skip-lock-tables --skip-dump-date --skip-add-locks \
$database > $(dirname "$path")/"$database".sql
$database > $(dirname "$dir")/"$database".sql
return 0
}

Archive Download the corresponding diff file

Branches