Merge pull request #127 from marineam/fix-tag

fix(tag_release): Fix cleanup of old branch manifests.
This commit is contained in:
Michael Marineau 2013-10-24 18:26:33 -07:00
commit 571ebef01f

View File

@ -26,14 +26,12 @@ TAG_NAME="v${FLAGS_build}.${FLAGS_branch}.${FLAGS_patch}"
cd "${GCLIENT_ROOT}/.repo/manifests"
# Clean up existing branch manifest(s)
if [[ $(ls branch-*.xml 2>/dev/null) ]]; then
for old_branch in branch-*.xml; do
if [[ "${old_branch}" != "${BRANCH_NAME}.xml" ]]; then
git rm -f "${old_branch}"
fi
done
fi
# Clean up existing branch manifest(s) excluding:
# - the current branch if the file already exists.
# - one previous branch, useful for comparing releases.
OLD_BRANCHES=$(find -maxdepth 1 -name 'build-*.xml' \
-not -name "${BRANCH_NAME}.xml" | sort -rn | tail -n -1)
git rm -f ${OLD_BRANCHES}
repo manifest -o "${BRANCH_NAME}.xml" -r
tee version.txt <<EOF