Fix stuff reported by shellcheck

This commit is contained in:
Alexandre Aubin 2021-10-06 18:56:17 +02:00
parent 28b1bbcc86
commit fd1cc5e6ce
2 changed files with 3 additions and 3 deletions

View file

@ -66,7 +66,7 @@ _ynh_app_config_apply_one() {
"set__${bind%%(*}" $short_setting $type $bind
elif [[ "$bind" == "null" ]]; then
continue
return
# Save in a file
elif [[ "$type" == "file" ]]; then

View file

@ -542,7 +542,7 @@ ynh_read_var_in_file() {
fi
# Remove comments if needed
local expression="$(echo "$expression_with_comment" | sed "s@$comments[^$string]*\$@@g" | sed "s@\s*[$endline]*\s*]*\$@@")"
local expression="$(echo "$expression_with_comment" | sed "s@${comments}[^$string]*\$@@g" | sed "s@\s*[$endline]*\s*]*\$@@")"
local first_char="${expression:0:1}"
if [[ "$first_char" == '"' ]]; then
@ -620,7 +620,7 @@ ynh_write_var_in_file() {
fi
# Remove comments if needed
local expression="$(echo "$expression_with_comment" | sed "s@$comments[^$string]*\$@@g" | sed "s@\s*[$endline]*\s*]*\$@@")"
local expression="$(echo "$expression_with_comment" | sed "s@${comments}[^$string]*\$@@g" | sed "s@\s*[$endline]*\s*]*\$@@")"
endline=${expression_with_comment#"$expression"}
endline="$(echo "$endline" | sed 's/\\/\\\\/g')"
value="$(echo "$value" | sed 's/\\/\\\\/g')"