diff --git a/Scripts/Bash/Functions/cli_checkPathComponent.sh b/Scripts/Bash/Functions/cli_checkPathComponent.sh index a664e78..a980bb7 100755 --- a/Scripts/Bash/Functions/cli_checkPathComponent.sh +++ b/Scripts/Bash/Functions/cli_checkPathComponent.sh @@ -75,22 +75,20 @@ function cli_checkPathComponent { fi ;; - '--default-filesystem' | * ) - if [[ $LOCATION == '' ]] \ - || [[ $LOCATION =~ '(\.\.(/)?)' ]] \ - || [[ ! $LOCATION =~ '^[A-Za-z0-9\.:/_-]+$' ]]; then - MESSAGE="`eval_gettext "The value \\\`\\\$LOCATION' is not valid."`" + '--repo-directory' ) + cli_checkPathComponent "$LOCATION" '--default' + if [[ $(dirname $LOCATION) != $(cli_getRepoName $LOCATION 'd') ]]; then + MESSAGE="`eval_gettext "The value \\\`\\\$LOCATION' is not a valid repository directory."`" fi ;; - '--default-repo-filesystem' ) - cli_checkPathComponent "$LOCATION" '--default-filesystem' - if [[ ! "$(dirname $LOCATION)" =~ "^$(cli_getRepoName $LOCATION 'd')$" ]] \ - || [[ ! "$(basename $LOCATION)" =~ "^$(cli_getRepoName $LOCATION 'f')$" ]];then + '--default' | * ) + if [[ $LOCATION == '' ]] \ + || [[ $LOCATION =~ '(\.\.(/)?)' ]] \ + || [[ ! $LOCATION =~ '^[A-Za-z0-9\.:/_-]+$' ]]; then MESSAGE="`eval_gettext "The value \\\`\\\$LOCATION' is not valid."`" fi ;; - esac # Output message.