From 5344fb90be3f898b4455acc96870fabdd6326f3f Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Sun, 1 Jul 2018 14:03:46 +0300 Subject: [PATCH] Added safety to release-helper.sh Change-Id: I4505f0e6c935a94ebd4a869e39455fe6ff10b91c --- releng/doc/release-helper.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/releng/doc/release-helper.sh b/releng/doc/release-helper.sh index 856182f22..cbd4f6206 100755 --- a/releng/doc/release-helper.sh +++ b/releng/doc/release-helper.sh @@ -114,12 +114,10 @@ case "$action" in ;; esac -if [ ! -d $version ]; then - echo "Version directory '$version' does not exist yet. Please run the 'clone' action first." - exit -1 +if [ -n "$version" ] && [ -d $version ]; then + pushd $version > /dev/null fi -pushd $version > /dev/null case "$action" in branch) for (( i=0; i<${repositoryCount}; i++ )); do @@ -223,6 +221,9 @@ case "$action" in ;; *) echo "Usage: ${self} clone|branch|checkout|fetch|list-tags|pull|push|push-tags|remove-tag|status|tag" + if [ -d $version ]; then + echo "Version directory ('$version') does not exist yet. Please run the 'clone' action first." + fi ;; esac -- 2.47.1