Blame Scripts/Bash/Functions/Help/help_addNewFilesToWorkingCopy.sh

4c79b5
#!/bin/bash
4c79b5
#
4c79b5
# help_addNewFilesToWorkingCopy.sh -- This function looks for files
4c79b5
# under the root documentation structure that are not versioned and
4c79b5
# adds them to the working copy under version control.
4c79b5
#
4c79b5
# Copyright (C) 2009-2010 Alain Reguera Delgado
4c79b5
# 
4c79b5
# This program is free software; you can redistribute it and/or modify
4c79b5
# it under the terms of the GNU General Public License as published by
4c79b5
# the Free Software Foundation; either version 2 of the License, or
4c79b5
# (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
# ----------------------------------------------------------------------
4c79b5
# $Id: help_addNewFilesToWorkingCopy.sh 98 2010-09-19 16:01:53Z al $
4c79b5
# ----------------------------------------------------------------------
4c79b5
4c79b5
function help_addNewFilesToWorkingCopy {
4c79b5
4c79b5
    local LOCATION=$1
4c79b5
4c79b5
    # Restrict files addition to your working copy only.
4c79b5
    if [[ ! $LOCATION =~ '^/home/centos/artwork/' ]];then
4c79b5
        cli_printMessage "`gettext "Only files under /home/centos/artwork please."`"
1f1b3c
        cli_printMessage "$(caller)" "AsToKnowMoreLine"
4c79b5
    fi
4c79b5
4c79b5
    # Update your working copy first.
4c79b5
    svn update $LOCATION --quiet
4c79b5
4c79b5
    # Add new files to your working copy.
4c79b5
    for FILE in $(svn status $LOCATION | egrep '^\?' | cut -d ' ' -f7);do
4c79b5
        svn add $FILE --quiet
4c79b5
    done
4c79b5
4c79b5
}