Closed maxim-belkin closed 4 years ago
Let me see if we can test this locally. I think we are using a different approach. I will share that with you via Slack once I confirm.
I think we should deprecate this and replace it with examples using modules.
I think we should deprecate this and replace it with examples using modules.
It makes to deprecate the script for Shifter 18, so I'm going to close this. If you want, I can submit it against shifter-16.08 branch -- just let me know.
Fix
contrib/gpu/activate_gpu_support.sh
script to use proper Bash syntax:Use double
[[ ... ]]
instead of[ ... ]
[[ ... ]]
is more robust than[ ... ]
and lets use use variables without having to put double quotes around them. Currently,log
function is called byparse_command_line_arguments
when wrong number of input arguments is specified. Thelog
functions fails because of theif [ $is_verbose_active = false ]; then
line becauseis_verbose_active
is not set and variables have to be double-quoted in[ ... ]
.double-quote all variables where necessary E.g.:
mount_dir=$(dirname "$mount_point")
Use proper Bash comparison Replace
if [ ! $# -eq 4 ]; then
withif [[ $# -ne 4 ]]; then
Avoid masking return values Example: change
to
because combined declaration + assignment masks the return value of
dirname $mount_point
and lets the script to proceed even whendirname
fails.