@@ -91,7 +91,8 @@ if [[ ! -f "${B3B_USE_CASE:-}/bootstrap.sh" ]]; then
91
91
echo " Please set B3B_USE_CASE to the bash3boilerplate use-case directory path."
92
92
exit 2
93
93
else
94
- source " ${B3B_USE_CASE} /bootstrap.sh" " $@ "
94
+ # shellcheck source=./prerequisites/use-case/bootstrap.sh
95
+ source " ${B3B_USE_CASE} /bootstrap.sh" " $@ "
95
96
fi
96
97
# ## End of boilerplate -- start user edits below #########################
97
98
@@ -111,6 +112,7 @@ trap cleanup_before_exit EXIT # The signal is specified here. Could be SIGINT, S
111
112
112
113
[ -z " ${LOG_LEVEL:- } " ] && emergency " Cannot continue without LOG_LEVEL. "
113
114
115
+ # shellcheck disable=SC2154
114
116
if [[ " ${arg_v} " == " ${__flag_present} " || " ${arg_l} " == " ${__flag_present} " || ! -z " ${arg_P:- ${arg_U:- ${arg_V:- ${arg_D} } } } " ]]; then
115
117
print_debug_only=7
116
118
if [ " $(( LOG_LEVEL < print_debug_only )) " -ne 0 ]; then
131
133
# ## Print bootstrapped magic variables to STDERR when LOG_LEVEL
132
134
# ## is at the default value (6) or above.
133
135
# ####################################################################
134
-
136
+ # shellcheck disable=SC2154
137
+ {
135
138
info " __file: ${__file} "
136
139
info " __dir: ${__dir} "
137
140
info " __base: ${__base} "
@@ -158,7 +161,7 @@ info "-P (--print-path): ${arg_P}"
158
161
info " -U (--print-url): ${arg_U} "
159
162
info " -v (--version): ${arg_v} "
160
163
info " -V (--print-version): ${arg_V} "
161
-
164
+ }
162
165
# This file is organized into three sections:
163
166
# 1. Command-line argument and environment variable processing.
164
167
# 2. Function definitions.
@@ -182,7 +185,8 @@ info "-V (--print-version): ${arg_V}"
182
185
183
186
# __________ Process command-line arguments and environment variables _____________
184
187
185
- export this_script=` basename $0 `
188
+ this_script=" $( basename " $0 " ) "
189
+ export this_script
186
190
187
191
export install_path=" ${arg_i} /${arg_p} "
188
192
info " install_path=${arg_i} /${arg_p} "
@@ -204,15 +208,19 @@ info "build_script=$opencoarrays_src_dir/prerequisites/build.sh"
204
208
205
209
# Include stack management functions
206
210
# . ./prerequisites/stack.sh
211
+ # shellcheck source=./prerequisites/stack.sh
207
212
source $opencoarrays_src_dir /prerequisites/stack.sh
208
213
stack_new dependency_pkg
209
214
stack_new dependency_exe
210
215
stack_new dependency_path
211
216
stack_new script_installed
212
-
217
+ # shellcheck source=./prerequisites/install-functions/find_or_install.sh
213
218
source $opencoarrays_src_dir /prerequisites/install-functions/find_or_install.sh
219
+ # shellcheck source=./prerequisites/install-functions/print_header.sh
214
220
source $opencoarrays_src_dir /prerequisites/install-functions/print_header.sh
221
+ # shellcheck source=./prerequisites/install-functions/build_opencoarrays.sh
215
222
source $opencoarrays_src_dir /prerequisites/install-functions/build_opencoarrays.sh
223
+ # shellcheck source=./prerequisites/install-functions/report_results.sh
216
224
source $opencoarrays_src_dir /prerequisites/install-functions/report_results.sh
217
225
218
226
# ___________________ End of function definitions for use in the Main Body __________________
@@ -224,7 +232,7 @@ source $opencoarrays_src_dir/prerequisites/install-functions/report_results.sh
224
232
if [[ " ${arg_v} " == " ${__flag_present} " || " ${arg_V} " == " opencoarrays" ]]; then
225
233
226
234
# Print script copyright if invoked with -v, -V, or --version argument
227
- cmake_project_line=` grep project CMakeLists.txt | grep VERSION`
235
+ cmake_project_line=$( grep project CMakeLists.txt | grep VERSION)
228
236
text_after_version_keyword=" ${cmake_project_line##* VERSION} "
229
237
text_before_language_keyword=" ${text_after_version_keyword%% LANGUAGES* } "
230
238
opencoarrays_version=$text_before_language_keyword
@@ -256,14 +264,15 @@ elif [[ ! -z "${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}" || "${arg_l}" == "${__fla
256
264
" ${opencoarrays_src_dir} " /prerequisites/build.sh " ${build_flag} " " ${build_arg} "
257
265
# Add lines other packages the current script builds
258
266
if [[ " ${arg_l} " == " ${__flag_present} " ]]; then
259
- echo " opencoarrays (version ` $ {opencoarrays_src_dir} /install.sh -V opencoarrays` )"
267
+ echo " opencoarrays (version $( " $ {opencoarrays_src_dir} /install.sh" -V opencoarrays) )"
260
268
echo " ofp (version: ofp-sdf for OS X )"
261
269
fi
262
270
263
271
elif [[ " ${arg_p:- } " == " opencoarrays" ]]; then
264
272
265
- cd prerequisites
273
+ cd prerequisites || exit 1
266
274
installation_record=install-opencoarrays.log
275
+ # shellcheck source=./prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh
267
276
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
268
277
set_SUDO_if_needed_to_write_to_directory " ${install_path} "
269
278
build_opencoarrays 2>&1 | tee ../" ${installation_record} "
0 commit comments