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