Skip to content

Commit d63ea50

Browse files
Merge pull request #1 from flexion/master
A little tidying
2 parents f62d29f + 0f24501 commit d63ea50

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

shell_script_template.bash

+21-20
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,24 @@ display_usage() {
118118
}
119119

120120

121+
###
122+
### If there is a library directory (lib/) relative to the
123+
### script's location by default), then attempt to source
124+
### the *.bash files located there.
125+
###
126+
127+
128+
if [ -n "${LIBRARY_PATH}" ] \
129+
&& [ -d "${LIBRARY_PATH}" ] ; then
130+
for library in "${LIBRARY_PATH}"*.bash ; do
131+
if [ -e "${library}" ] ; then
132+
# shellcheck disable=SC1090
133+
. "${library}"
134+
fi
135+
done
136+
fi
137+
138+
121139
## @fn main()
122140
## @brief This is the main program loop.
123141
## @details
@@ -128,25 +146,7 @@ main() {
128146

129147
trap die ERR
130148

131-
132-
###
133-
### If there is a library directory (lib/) relative to the
134-
### script's location by default), then attempt to source
135-
### the *.bash files located there.
136-
###
137-
138-
139-
if [ -n "${LIBRARY_PATH}" ] \
140-
&& [ -d "${LIBRARY_PATH}" ] ; then
141-
for library in "${LIBRARY_PATH}"*.bash ; do
142-
if [ -e "${library}" ] ; then
143-
# shellcheck disable=SC1090
144-
. "${library}"
145-
fi
146-
done
147-
fi
148-
149-
149+
150150
###
151151
### set values from their defaults here
152152
###
@@ -188,7 +188,7 @@ main() {
188188

189189

190190
###
191-
### Process positional arguments
191+
### process positional arguments
192192
###
193193

194194

@@ -201,6 +201,7 @@ main() {
201201
### program logic goes here
202202
###
203203

204+
204205
printf "%s %s %s the %s is the word\n" "$word" "$word" "$word" "$word"
205206

206207
}

0 commit comments

Comments
 (0)