From f925a2e509b59a13e3361b63a982cb57b75d68d7 Mon Sep 17 00:00:00 2001 From: Pedro Salgado Date: Fri, 30 Dec 2016 20:08:54 -0700 Subject: [PATCH] generate_releases.sh: only update releases if releases.txt.tmp file exists. --- generate_releases.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/generate_releases.sh b/generate_releases.sh index c99265e..50a07c5 100755 --- a/generate_releases.sh +++ b/generate_releases.sh @@ -70,9 +70,13 @@ do done - echo "generating ${ODOO_VERSION}/releases.txt..." - paste -d '\n' "${ODOO_VERSION}/releases.txt" "${ODOO_VERSION}/releases.txt.tmp" | sort -r | uniq > "${ODOO_VERSION}/releases.txt.out" - mv "${ODOO_VERSION}/releases.txt.out" "${ODOO_VERSION}/releases.txt" - rm "${ODOO_VERSION}/releases.txt.tmp" + if [[ -f "${ODOO_VERSION}/releases.txt.tmp" ]]; then + # releases.txt.tmp file exists => there are changes to be processed + + echo "generating ${ODOO_VERSION}/releases.txt..." + paste -d '\n' "${ODOO_VERSION}/releases.txt" "${ODOO_VERSION}/releases.txt.tmp" | sort -r | uniq > "${ODOO_VERSION}/releases.txt.out" + mv "${ODOO_VERSION}/releases.txt.out" "${ODOO_VERSION}/releases.txt" + rm "${ODOO_VERSION}/releases.txt.tmp" + fi done