From 64146e144cb4e2170474100a3652ef53e7d21393 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: May 29 2011 03:14:06 +0000 Subject: Update cli_getRepoTLDir.sh. --- diff --git a/Scripts/Functions/cli_getRepoTLDir.sh b/Scripts/Functions/cli_getRepoTLDir.sh index d8ac11f..f59e66e 100755 --- a/Scripts/Functions/cli_getRepoTLDir.sh +++ b/Scripts/Functions/cli_getRepoTLDir.sh @@ -54,10 +54,14 @@ function cli_getRepoTLDir { local LOCATION=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') # Verify location passed as non-option argument. If no location is - # passed as non-option argument to this function, then use action - # value as default location. + # passed as non-option argument to this function, then evaluate + # the action value to set default location. if [[ $LOCATION == '--' ]];then - LOCATION=$ACTIONVAL + if [[ $ACTIONVAL != '' ]];then + LOCATION=$ACTIONVAL + else + LOCATION=${HOME}/artwork/trunk + fi fi # Verify location where the working copy should be stored in the @@ -65,7 +69,7 @@ function cli_getRepoTLDir { # to one of the top level directories inside the working copy of # CentOS Artwork Repository which, in turn, should be sotred in # the `artwork' directory immediatly under your home directory. - if [[ ! $LOCATION =~ "^${HOME}/artwork/(trunk|branches|tags)/.+$" ]];then + if [[ ! $LOCATION =~ "^${HOME}/artwork/(trunk|branches|tags)" ]];then cli_printMessage "`eval_gettext "The location \\\"\\\$LOCATION\\\" is not valid."`" --as-error-line fi