| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function prepare_updateLinks { |
| |
| local -a LINKS_SRC |
| local -a LINKS_DST |
| local USERFILES='' |
| local PALETTE='' |
| local BRUSH='' |
| local PATTERN='' |
| local FONT='' |
| local FILE='' |
| local COUNT=0 |
| |
| |
| |
| local GIMP_DIR=${HOME}/.$(rpm -q gimp | cut -d. -f-2) |
| local GIMP_DIR_BRUSHES=${GIMP_DIR}/brushes |
| local GIMP_DIR_PALETTES=${GIMP_DIR}/palettes |
| local GIMP_DIR_PATTERNS=${GIMP_DIR}/patterns |
| local INKS_DIR=${HOME}/.inkscape |
| local INKS_DIR_PALETTES=${INKS_DIR}/palettes |
| local FONT_DIR=${HOME}/.fonts |
| local APPS_DIR=${HOME}/bin |
| |
| |
| |
| local WCDIR=${TCAR_WORKDIR}/Identity |
| local WCDIR_BRUSHES=${WCDIR}/Brushes |
| local WCDIR_PALETTES=${WCDIR}/Palettes |
| local WCDIR_PATTERNS=${WCDIR}/Patterns |
| local WCDIR_FONTS=${WCDIR}/Fonts |
| local WCDIR_EDITOR=${PREPARE_CONFIG_DIR} |
| |
| |
| |
| |
| |
| for DIR in $(echo "Brushes Palettes Patterns Fonts");do |
| cli_checkFiles ${WCDIR}/${DIR} |
| done |
| |
| |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${APPS_DIR}/${CLI_NAME} |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${CLI_BASEDIR}/${CLI_NAME}.sh |
| USERFILES="${APPS_DIR}/${CLI_NAME}" |
| |
| |
| for FONT in $(cli_getFilesList "${WCDIR_FONTS}" --pattern='^.+\.ttf$');do |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${FONT_DIR}/$(basename $FONT) |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${FONT} |
| done |
| |
| |
| for PALETTE in $(cli_getFilesList "${WCDIR_PALETTES}" --pattern="^.+\.gpl$");do |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE}) |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE} |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${INKS_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE}) |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE} |
| done |
| |
| |
| for BRUSH in $(cli_getFilesList "${WCDIR_BRUSHES}" --pattern="^.+\.(gbr|gih)$");do |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_BRUSHES}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH}) |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${BRUSH} |
| done |
| |
| |
| for PATTERN in $(cli_getFilesList "${WCDIR_PATTERNS}" --pattern="^.+\.png$");do |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PATTERNS}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH}) |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${PATTERN} |
| done |
| |
| |
| if [[ $EDITOR == '/usr/bin/vim' ]];then |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${HOME}/.vimrc |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${WCDIR_EDITOR}/vim.conf |
| USERFILES="${USERFILES} ${HOME}/.vimrc" |
| fi |
| |
| |
| |
| |
| |
| |
| |
| |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css/reset.css |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Style-guide/0.0.1/Css/reset.css |
| |
| |
| |
| |
| |
| |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Style-guide/0.0.1/Images |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Images/Webenv |
| |
| |
| |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Images/Webenv/Manuals |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Images/Manuals |
| |
| |
| |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Images/Webenv/logo-centos.png |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Images/Brands/Logos/White/78/centos.png |
| |
| |
| |
| |
| |
| |
| USERFILES=$(echo "$USERFILES"; |
| cli_getFilesList ${APPS_DIR} --pattern='^.+\.sh$'; |
| cli_getFilesList ${FONT_DIR} --pattern='^.+\.ttf$'; |
| cli_getFilesList ${GIMP_DIR_BRUSHES} --pattern='^.+\.(gbr|gih)$'; |
| cli_getFilesList ${GIMP_DIR_PATTERNS} --pattern='^.+\.(pat|png|jpg|bmp)$'; |
| cli_getFilesList ${GIMP_DIR_PALETTES} --pattern='^.+\.gpl$'; |
| cli_getFilesList ${INKS_DIR_PALETTES} --pattern='^.+\.gpl$';) |
| |
| |
| |
| |
| |
| if [[ "$USERFILES" != '' ]];then |
| rm -r $USERFILES |
| fi |
| |
| while [[ $COUNT -lt ${#LINKS_SRC[*]} ]];do |
| |
| |
| cli_printMessage "${LINKS_SRC[$COUNT]}" --as-creating-line |
| |
| |
| if [[ ! -d $(dirname ${LINKS_SRC[$COUNT]}) ]];then |
| mkdir -p $(dirname ${LINKS_SRC[$COUNT]}) |
| fi |
| |
| |
| |
| |
| if [[ -a ${LINKS_SRC[$COUNT]} ]];then |
| rm ${LINKS_SRC[$COUNT]} |
| fi |
| |
| |
| ln ${LINKS_DST[$COUNT]} ${LINKS_SRC[$COUNT]} --symbolic --force |
| |
| |
| COUNT=$(($COUNT + 1)) |
| |
| done |
| |
| } |