From cc78fa9d32d1d321173b920a6e709e78c8068e37 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Feb 25 2011 17:31:10 +0000 Subject: Move verification of FILES variable from cli_getFilesList to cli_printActionPreamble: - When FILES verification is on cli_getFilesList, the output is correct but script flow doesn't ends with the exit command from cli_printMessage "$(caller)" 'AsToKnowMoreLine'. --- diff --git a/Scripts/Bash/centos-art/Functions/cli_getFilesList.sh b/Scripts/Bash/centos-art/Functions/cli_getFilesList.sh index 033cb67..679cec5 100755 --- a/Scripts/Bash/centos-art/Functions/cli_getFilesList.sh +++ b/Scripts/Bash/centos-art/Functions/cli_getFilesList.sh @@ -66,17 +66,6 @@ function cli_getFilesList { FILES=$LOCATION fi - # Check list of files to process. If we have an empty list of - # files, inform about that and stop the script execution. - # Otherwise, check all files in the list to be sure they are - # regular files. - if [[ "$FILES" == '' ]];then - cli_printMessage "`gettext "There is no file to process."`" 'AsErrorLine' - cli_printMessage "$(caller)" 'AsToKnowMoreLine' - else - cli_checkFiles "${FILES}" 'f' - fi - # Output list of files to process. echo "$FILES" diff --git a/Scripts/Bash/centos-art/Functions/cli_printActionPreamble.sh b/Scripts/Bash/centos-art/Functions/cli_printActionPreamble.sh index 71034e6..f3bcc8f 100755 --- a/Scripts/Bash/centos-art/Functions/cli_printActionPreamble.sh +++ b/Scripts/Bash/centos-art/Functions/cli_printActionPreamble.sh @@ -38,6 +38,17 @@ function cli_printActionPreamble { local ACTION="$2" local FORMAT="$3" + # Check list of files to process. If we have an empty list of + # files, inform about that and stop the script execution. + # Otherwise, check all files in the list to be sure they are + # regular files. + if [[ "$FILES" == '' ]];then + cli_printMessage "`gettext "There is no file to process."`" 'AsErrorLine' + cli_printMessage "$(caller)" 'AsToKnowMoreLine' + else + cli_checkFiles "${FILES}" 'f' + fi + # Verify that all function parameters are passed. If they are not, # there is nothing else to do here. if [[ $# -ne 3 ]];then