| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_checkRepoDirTarget { |
| |
| |
| cli_checkPathComponent "$FLAG_TO" '--repo-directory' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| if [[ $FLAG_TO =~ '^(trunk|branches|tags)/.+$' ]];then |
| FLAG_TO=${HOME}/artwork/$FLAG_TO |
| fi |
| |
| |
| if [[ -a ${FLAG_TO} ]];then |
| |
| |
| |
| |
| cli_printMessage "`eval_gettext "The location \\\`\\\$FLAG_TO' already exists."`" 'AsErrorLine' |
| cli_printMessage "$(caller)" 'AsToKnowMoreLine' |
| |
| else |
| |
| # At this point existent locations inside working copy and |
| # invalid urls have been discarded. Assume a new target |
| # location has being specified. So, build the absolute path |
| # for it. |
| |
| # Add directory to the top of the directory stack. |
| pushd "$(dirname "$FLAG_TO")" > /dev/null |
| |
| # Check directory existence inside the repository. |
| if [[ $(pwd) =~ "^${HOME}/artwork" ]];then |
| # Re-define target value using absolute path. |
| FLAG_TO=$(pwd)/$(basename "$FLAG_TO") |
| fi |
| |
| # Remove directory from the directory stack. |
| popd > /dev/null |
| |
| # Verify target location. It is required that target location |
| # points to an entry under (trunk|branches|tags)/Identity/... |
| # directory structure *only*. Remember that Identity parent |
| # directory structure is the reference used to create parallel |
| # directories (i.e., documentation, configuration scripts, |
| # translations, etc.). We don't manipulate parallel |
| |
| |
| |
| |
| if [[ ! ${FLAG_TO} =~ '^.+/(trunk|branches|tags)/Identity/.+$' ]];then |
| cli_printMessage "`eval_gettext "cannot create \\\`\\\$FLAG_TO': It isn't an identity directory structure."`" 'AsErrorLine' |
| cli_printMessage "$(caller)" 'AsToKnowMoreLine' |
| fi |
| fi |
| |
| } |