| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_checkRepoDirSource { |
| |
| |
| |
| cli_checkPathComponent $ACTIONVAL |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| if [[ $ACTIONVAL =~ '^(trunk|branches|tags)' ]];then |
| ACTIONVAL=${HOME}/artwork/$ACTIONVAL |
| fi |
| |
| |
| |
| |
| |
| |
| |
| |
| if [[ -d ${ACTIONVAL} ]];then |
| |
| |
| pushd "$ACTIONVAL" > /dev/null |
| |
| |
| if [[ $(pwd) =~ "^${HOME}/artwork" ]];then |
| |
| ACTIONVAL=$(pwd) |
| else |
| cli_printMessage "`eval_gettext "The location \\\"\\\$ACTIONVAL\\\" is not valid."`" --as-error-line |
| fi |
| |
| # Remove directory from the directory stack. |
| popd > /dev/null |
| |
| elif [[ -f ${ACTIONVAL} ]];then |
| |
| # Add directory to the top of the directory stack. |
| pushd "$(dirname "$ACTIONVAL")" > /dev/null |
| |
| # Check directory existence inside the repository. |
| if [[ $(pwd) =~ "^${HOME}/artwork" ]];then |
| # Re-define source value using absolute path. |
| ACTIONVAL=$(pwd)/$(basename "$ACTIONVAL") |
| else |
| cli_printMessage "`eval_gettext "The location \\\"\\\$ACTIONVAL\\\" is not valid."`" --as-error-line |
| fi |
| |
| # Remove directory from the directory stack. |
| popd > /dev/null |
| |
| else |
| |
| # At this there is no existent working copy entry, nor a valid |
| # url. The source value can only be considered as such if it |
| # is an existent working copy or valid url. So, print a |
| # message and stop script execution. |
| cli_printMessage "`eval_gettext "The location \\\"\\\$ACTIONVAL\\\" is not valid."`" --as-error-line |
| |
| fi |
| |
| } |
| |