Make helper variables local to prefent side effects
This commit is contained in:
@@ -219,6 +219,7 @@ getReturn() {
|
|||||||
# MESSAGE : Custom error message
|
# MESSAGE : Custom error message
|
||||||
#
|
#
|
||||||
endReturn() {
|
endReturn() {
|
||||||
|
local arg
|
||||||
local forceExit=0
|
local forceExit=0
|
||||||
local errorCode=$ERNO
|
local errorCode=$ERNO
|
||||||
local endMessage=""
|
local endMessage=""
|
||||||
@@ -296,6 +297,7 @@ endReturn() {
|
|||||||
# 2 : Created empty configuration
|
# 2 : Created empty configuration
|
||||||
# 3 : No configuration created
|
# 3 : No configuration created
|
||||||
initSeqConfig() {
|
initSeqConfig() {
|
||||||
|
local arg
|
||||||
local sourceAlways=0
|
local sourceAlways=0
|
||||||
local createEmpty=0
|
local createEmpty=0
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
@@ -376,6 +378,7 @@ initSeqConfig() {
|
|||||||
# if exists, one attempt is made to create bck file of it
|
# if exists, one attempt is made to create bck file of it
|
||||||
# if all fails, a log file is created with the conflicts to be resolved by the user
|
# if all fails, a log file is created with the conflicts to be resolved by the user
|
||||||
addConf() {
|
addConf() {
|
||||||
|
local arg
|
||||||
local confMode=""
|
local confMode=""
|
||||||
local transferCmd="echo"
|
local transferCmd="echo"
|
||||||
|
|
||||||
@@ -598,6 +601,7 @@ step() {
|
|||||||
# (max $MAX_STEP)
|
# (max $MAX_STEP)
|
||||||
# execute sequence continously from given starting step
|
# execute sequence continously from given starting step
|
||||||
continous() {
|
continous() {
|
||||||
|
local i
|
||||||
local step=0
|
local step=0
|
||||||
|
|
||||||
checkStep "$1"
|
checkStep "$1"
|
||||||
@@ -625,6 +629,7 @@ continous() {
|
|||||||
# execute given step list
|
# execute given step list
|
||||||
# e.g.: selection -q (1, 4, 12)
|
# e.g.: selection -q (1, 4, 12)
|
||||||
selection() {
|
selection() {
|
||||||
|
local i
|
||||||
local step=0
|
local step=0
|
||||||
local array=("$@")
|
local array=("$@")
|
||||||
|
|
||||||
@@ -695,6 +700,7 @@ createTemplate() {
|
|||||||
# back reference variable of schema:
|
# back reference variable of schema:
|
||||||
# alias_[ALIAS]=[STEP NUMBER]
|
# alias_[ALIAS]=[STEP NUMBER]
|
||||||
parseAlias() {
|
parseAlias() {
|
||||||
|
local i
|
||||||
for ((i=1; i<=${MAX_STEP}; i++)); do
|
for ((i=1; i<=${MAX_STEP}; i++)); do
|
||||||
# Check for alias definition
|
# Check for alias definition
|
||||||
existsFunction step_${i}_alias
|
existsFunction step_${i}_alias
|
||||||
@@ -715,6 +721,7 @@ parseAlias() {
|
|||||||
# 1 : Do not ask for template creation
|
# 1 : Do not ask for template creation
|
||||||
# Always display sequencer help and, if available, sequence help
|
# Always display sequencer help and, if available, sequence help
|
||||||
displayHelp() {
|
displayHelp() {
|
||||||
|
local i
|
||||||
local createTemplate=1
|
local createTemplate=1
|
||||||
local stepsFound=0
|
local stepsFound=0
|
||||||
CONTEXT_HELP=1
|
CONTEXT_HELP=1
|
||||||
@@ -827,6 +834,7 @@ exep() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
local arg
|
||||||
local START=0
|
local START=0
|
||||||
local EMPTYCALL=1
|
local EMPTYCALL=1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user