Blame Scripts/Bash/Cli/Functions/Prepare/prepare_pathToInkscape.sh

3b853a
#!/bin/bash
3b853a
#
1700f3
# prepare_pathToInkscape.sh -- This function prepares user's
3b853a
# ~/.inkscape configurations directory to use CentOS defaults (e.g.,
3b853a
# palettes, patterns, etc).
3b853a
#
9f5f2e
# Copyright (C) 2009-2011 Alain Reguera Delgado
3b853a
# 
7cd8e9
# This program is free software; you can redistribute it and/or
7cd8e9
# modify it under the terms of the GNU General Public License as
7cd8e9
# published by the Free Software Foundation; either version 2 of the
7cd8e9
# License, or (at your option) any later version.
3b853a
# 
3b853a
# This program is distributed in the hope that it will be useful, but
3b853a
# WITHOUT ANY WARRANTY; without even the implied warranty of
3b853a
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3b853a
# General Public License for more details.
3b853a
#
3b853a
# You should have received a copy of the GNU General Public License
3b853a
# along with this program; if not, write to the Free Software
3b853a
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
3b853a
# USA.
3b853a
# 
3b853a
# ----------------------------------------------------------------------
3b853a
# $Id$
3b853a
# ----------------------------------------------------------------------
3b853a
1700f3
function prepare_pathToInkscape {
3b853a
3b853a
    # Define variables as local to avoid conflicts outside.
3b853a
    local -a REPODIRS
3b853a
    local -a REPOFILES
3b853a
    local -a REPOLINKS
01d859
    local FILE=''
3b853a
3b853a
    # Define directories required by the centos-art.sh script command
3b853a
    # line interface. 
7b46a4
    REPODIRS[0]=${HOME}/.inkscape/palettes
7b46a4
    REPODIRS[1]=$(cli_getRepoTLDir)/Identity/Colors
3b853a
3b853a
    # Define files required by the centos-art.sh script command line
3b853a
    # interface.
4b8e06
    REPOFILES[0]=${REPODIRS[1]}/CentOS.gpl
3b853a
3b853a
    # Define symbolic links required by the centos-art.sh script
3b853a
    # command line interface.
4b8e06
    REPOLINKS[0]=${REPODIRS[0]}/CentOS.gpl
3b853a
01d859
    # Check defined directories.
01d859
    for FILE in "${REPODIRS[@]}";do
01d859
        cli_checkFiles $FILE 'd'
01d859
    done
01d859
01d859
    # Check defined files.
01d859
    for FILE in "${REPOFILES[@]}";do
01d859
        cli_checkFiles $FILE 'f'
01d859
    done
01d859
01d859
    # Check defined symbolic links.
01d859
    for FILE in "${REPOLINKS[@]}";do
01d859
        cli_checkFiles $FILE 'h'
01d859
    done
3b853a
3b853a
}