Blame Scripts/Bash/Functions/cli_getThemeName.sh

4c79b5
#!/bin/bash
4c79b5
#
4c79b5
# cli_getThemeName.sh -- This function manipulates the current
4c79b5
# absolute path to extract the theme name from it. If there is no
4c79b5
# theme in the path, this function returns an empty string.
4c79b5
#
7cd8e9
# Copyright (C) 2009, 2010 Alain Reguera Delgado
4c79b5
# 
4c79b5
# This program is free software; you can redistribute it and/or
4c79b5
# modify it under the terms of the GNU General Public License as
4c79b5
# published by the Free Software Foundation; either version 2 of the
4c79b5
# License, or (at your option) any later version.
4c79b5
# 
4c79b5
# This program is distributed in the hope that it will be useful, but
4c79b5
# WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
4c79b5
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
4c79b5
# USA.
4c79b5
# 
4c79b5
# ----------------------------------------------------------------------
418249
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
4c79b5
function cli_getThemeName {
4c79b5
4c79b5
    local THEMENAME=''
4c79b5
c9f2b8
    if [[ $ACTIONVAL =~ '^.+/Themes/Motifs/([A-Za-z0-9-]+)/.+$' ]];then
c9f2b8
        THEMENAME=$(echo $ACTIONVAL \
841480
            | sed -r "s!^.+/Themes/Motifs/([A-Za-z0-9-]+(/${RELEASE_FORMAT})?)/.+!\1!") 
4c79b5
    fi
4c79b5
4c79b5
    echo $THEMENAME
4c79b5
}