From: Tuukka Lehtonen Date: Sun, 1 Jul 2018 11:03:46 +0000 (+0300) Subject: Added safety to release-helper.sh X-Git-Tag: v1.43.0~136^2~448 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=5344fb90be3f898b4455acc96870fabdd6326f3f;p=simantics%2Fplatform.git Added safety to release-helper.sh Change-Id: I4505f0e6c935a94ebd4a869e39455fe6ff10b91c --- 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