| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_getRepoTLDir { |
| |
| local PATTERN='' |
| local REPLACE='' |
| local LOCATION='' |
| |
| |
| |
| |
| if [[ "$1" != '' ]];then |
| LOCATION="$1" |
| else |
| LOCATION="$ACTIONVAL" |
| fi |
| |
| |
| if [[ $LOCATION =~ "^${HOME}/artwork/(trunk|branches|tags)/.+$" ]];then |
| case "$2" in |
| -r|--relative ) |
| PATTERN="^${HOME}/artwork/(trunk|branches|tags)/.+$" |
| REPLACE='\1' |
| ;; |
| -a|--absolute|* ) |
| PATTERN="^(${HOME}/artwork/(trunk|branches|tags))/.+$" |
| REPLACE='\1' |
| ;; |
| esac |
| else |
| cli_printMessage "${FUNCNAME}: `eval_gettext "The location \\\`\\\$LOCATION' is not valid."`" 'AsErrorLine' |
| cli_printMessage "${FUNCDIRNAM}" 'AsToKnowMoreLine' |
| fi |
| |
| # Print location. |
| echo $LOCATION | sed -r "s!${PATTERN}!${REPLACE}!g" |
| |
| } |
| |