From 3f39a04a582ad58327cbac7bc1f657b0c8d15996 Mon Sep 17 00:00:00 2001 From: Romain Pelisse Date: Sun, 11 Sep 2011 19:16:14 +0000 Subject: [PATCH] move current_dir check in an earlier step of the script git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7247 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/etc/generate_release.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pmd/etc/generate_release.sh b/pmd/etc/generate_release.sh index f66e0a671b..270d222e53 100644 --- a/pmd/etc/generate_release.sh +++ b/pmd/etc/generate_release.sh @@ -43,21 +43,17 @@ while getopts v:dsh OPT; do esac done +current_dir=$(pwd | sed -e 's/^.*\///') +if [ "${current_dir}" != "etc" ]; then + echo "release script MUST be executed from the 'etc' folder" + exit 3 +fi + if [ -z ${version} ]; then check_dependency "xsltproc" readonly version=$(xsltproc extract_release_number.xslt ../pom.xml | grep VERSION | cut -f2 -d: | sed -e 's/-SNAPSHOT//') fi -check_dependency "ant" -check_dependency "maven" -check_dependency "mvn" - -current_dir=$(pwd | sed -e 's/^.*\///') -if [ "${current_dir}" -ne "etc" ], then - echo "release script MUST be executed from the 'etc' folder" - exit 3 -fi - echo "building release version ${version}" pmd_top_dir="$(mktemp -d)"