From 7a9ba5597d921992d52d8e5907f57a51069dee80 Mon Sep 17 00:00:00 2001 From: LakshmiRavali Date: Sat, 28 Aug 2021 09:31:20 +0530 Subject: [PATCH] fix: Added condition to check changeLog.md file exist or not --- scripts/updateApiDefinitions.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/updateApiDefinitions.sh b/scripts/updateApiDefinitions.sh index 5ffcf00d..836c6c0d 100644 --- a/scripts/updateApiDefinitions.sh +++ b/scripts/updateApiDefinitions.sh @@ -3,15 +3,19 @@ echo "Copying api-definitions" cp -R ~/oai_definitions/json/. src/services/twilio-api/ echo "Running update changelog script" node scripts/update-api-definitions.js -changeLog=$(cat changeLog.md) -rm -rf changeLog.md -if [ "$changeLog" != '' ]; then - changeLog="${changeLog//'%'/'%25'}" - changeLog="${changeLog//$'\n'/'%0A'}" - changeLog="${changeLog//$'\r'/'%0D'}" +changeLog='' +versionType=-1 +if [ -f changeLog.md ]; then + changeLog=$(cat changeLog.md) + rm -rf changeLog.md + if [ "$changeLog" != '' ]; then + changeLog="${changeLog//'%'/'%25'}" + changeLog="${changeLog//$'\n'/'%0A'}" + changeLog="${changeLog//$'\r'/'%0D'}" + versionType=$(node scripts/get-version-type.js | tail -n -1) + fi fi echo "Changelog: $changeLog" -versionType=$(node scripts/get-version-type.js | tail -n -1) echo "Version type: $versionType" rm -rf OAI_CHANGES.md echo "Git configurations"