Browse Source
Considering finish hooks, to only update the rev file if compile was successful for vcs. Not sure yet.master
mid-kid
9 years ago
11 changed files with 30 additions and 56 deletions
@ -1,22 +1,26 @@ |
|||||
vcs_git() { |
vcs_git() { |
||||
if [ ! -d "$dir_source/$name/vcs" ]; then |
_func_reponame="$(basename "$1")" |
||||
rm -rf "$dir_source/$name/vcs" |
_func_dir="$dir_source/$name/$_func_reponame" |
||||
git clone --recursive --depth=1 "$1" "$dir_source/$name/vcs" |
|
||||
vcs_compile=true |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
_hook_git() { |
|
||||
cd "$dir_source/$name/vcs" |
|
||||
|
|
||||
git pull > /dev/null |
if [ ! -d "$_func_dir" ]; then |
||||
_func_rev="$(git rev-parse @)" |
# Clone new repo |
||||
if [ "$_func_rev" != "$(cat "$dir_source/$name/vcs_rev_$_satname" 2> /dev/null || true)" ]; then |
git clone --recursive --depth=1 "$1" "$_func_dir" |
||||
echo "$_func_rev" > "$dir_source/$name/vcs_rev_$_satname" |
cd "$_func_dir" |
||||
|
echo "$(git rev-parse @)" > "${_func_dir}_rev_$_satname" |
||||
vcs_compile=true |
vcs_compile=true |
||||
|
else |
||||
|
cd "$_func_dir" |
||||
|
|
||||
|
git pull > /dev/null |
||||
|
_func_rev="$(git rev-parse @)" |
||||
|
if [ "$_func_rev" != "$(cat "${_func_dir}_rev_$_satname" 2> /dev/null || true)" ]; then |
||||
|
echo "$_func_rev" > "${_func_dir}_rev_$_satname" |
||||
|
vcs_compile=true |
||||
|
fi |
||||
fi |
fi |
||||
|
|
||||
version="$(git rev-list HEAD --count)_$(git rev-parse --short HEAD)" |
version="$(git rev-list HEAD --count)_$(git rev-parse --short HEAD)" |
||||
cd "$OLDPWD" |
cd "$OLDPWD" |
||||
} |
|
||||
|
|
||||
_hooks="_hook_git" |
getfile "$_func_dir" |
||||
|
} |
||||
|
Loading…
Reference in new issue