| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function prepare_updateEnvironment { |
| |
| |
| |
| |
| if [[ ! $0 =~ "^${HOME}/.+/${CLI_NAME}.sh$" ]];then |
| cli_printMessage "`gettext "To set environment variables you should run centos-art.sh using its abosolute path."`" --as-error-line |
| fi |
| |
| local PROFILE=bash_profile |
| local SOURCE=${PREPARE_CONFIG_DIR}/${PROFILE}.conf |
| local TARGET=${HOME}/.${PROFILE} |
| |
| |
| |
| |
| |
| if [[ $TCAR_WORKDIR =~ "^${HOME}/bin" ]];then |
| cli_printMessage "`eval_gettext "The repository working directory cannot be $HOME/bin"`" --as-error-line |
| else |
| local TCAR_WORKDIR=$(dirname "$0" | sed "s,/${TCAR_BASHSCRIPTS},,") |
| fi |
| |
| |
| |
| |
| |
| local TCAR_BRAND='centos' |
| |
| |
| cli_printMessage "${TARGET}" --as-updating-line |
| |
| |
| |
| |
| cp -f $SOURCE $TARGET |
| |
| |
| sed -i -r \ |
| -e "s,^(TCAR_WORKDIR=).*,\1${TCAR_WORKDIR}," \ |
| -e "s,^(TCAR_BRAND=).*,\1${TCAR_BRAND}," \ |
| ${TARGET} |
| |
| } |