Only record the new commit if all goes well

This commit is contained in:
Bob Mottram 2016-06-29 16:48:19 +01:00
parent e36a4b876c
commit 634773fcf6
No known key found for this signature in database
GPG Key ID: BA68F26108DC9F87
1 changed files with 2 additions and 1 deletions

View File

@ -1668,7 +1668,6 @@ function set_repo_commit {
if [[ "$CURRENT_REPO_COMMIT" != "$repo_commit" ]]; then if [[ "$CURRENT_REPO_COMMIT" != "$repo_commit" ]]; then
cd $repo_dir cd $repo_dir
git_pull $repo_url $repo_commit git_pull $repo_url $repo_commit
sed -i "s/${repo_commit_name}.*/${repo_commit_name}:$repo_commit/g" $COMPLETION_FILE
# application specific stuff after updating the repo # application specific stuff after updating the repo
if [[ $repo_dir == *"www"* ]]; then if [[ $repo_dir == *"www"* ]]; then
@ -1743,6 +1742,8 @@ function set_repo_commit {
systemctl restart ipfs systemctl restart ipfs
systemctl daemon-reload systemctl daemon-reload
fi fi
sed -i "s/${repo_commit_name}.*/${repo_commit_name}:$repo_commit/g" $COMPLETION_FILE
fi fi
else else
echo "${repo_commit_name}:${repo_commit}" >> $COMPLETION_FILE echo "${repo_commit_name}:${repo_commit}" >> $COMPLETION_FILE