Blame Scripts/Functions/Render/Svg/svg_doPostCommand.sh

c979f9
#!/bin/bash
c979f9
#
26026e
# svg_doPostCommand.sh -- This function standardizes the way
26026e
# post-rendition commands are applied to base-rendition output.
c979f9
#
3b0984
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
3b0984
# the Free Software Foundation; either version 2 of the License, or (at
3b0984
# your option) any later version.
fa95b1
#
74a058
# This program is distributed in the hope that it will be useful, but
74a058
# WITHOUT ANY WARRANTY; without even the implied warranty of
c979f9
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
c979f9
# General Public License for more details.
c979f9
#
c979f9
# You should have received a copy of the GNU General Public License
c979f9
# along with this program; if not, write to the Free Software
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
c979f9
# ----------------------------------------------------------------------
c979f9
# $Id$
c979f9
# ----------------------------------------------------------------------
c979f9
26026e
function svg_doPostCommand {
c979f9
b31be0
    # Define the file extension of base-rendition output.
fbcc3d
    local EXTENSION=$(render_getConfigOption "$ACTION" '2')
c979f9
b31be0
    # Define the command string.
fbcc3d
    local COMMAND=$(render_getConfigOption "$ACTION" '3-')
fbcc3d
417308
    # Verify the absolute path of base-rendition output.
fbcc3d
    cli_checkFiles ${FILE}.${EXTENSION}
9b8686
b31be0
    # Execute the command string on base-rendition output.
fbcc3d
    eval $COMMAND ${FILE}.${EXTENSION}
fbcc3d
b31be0
    # Be sure the command string was executed correctly. Otherwise
b31be0
    # stop the script execution.
fbcc3d
    if [[ $? -ne 0 ]];then
fbcc3d
        exit
fbcc3d
    fi
c979f9
c979f9
}