1
0
mirror of https://git.envs.net/envs/ops.git synced 2024-06-15 05:16:37 +00:00

small envs_user_updated.sh optimations

This commit is contained in:
creme 2019-11-29 11:29:45 +01:00
parent 8e97f26ad3
commit d4a11664f8
Signed by: creme
GPG Key ID: C147C3B7FBDF08D0

View File

@ -183,15 +183,15 @@ EOM
EOM EOM
else else
# continue user def. array # continue user def. array
if ! [[ "$field_count" -eq '0' ]]; then cat << EOM >> "$TMP_JSON"
cat << EOM >> "$TMP_JSON"
"${line_to_set[$field]}", "${line_to_set[$field]}",
EOM EOM
# end of user def. array if [[ "$field_count" -eq '0' ]]; then
else # end of user def. array
# remove trailing ',' on last user entry
unset field_in_progress unset field_in_progress
sed -i '$ s/,$//' "$TMP_JSON"
cat << EOM >> "$TMP_JSON" cat << EOM >> "$TMP_JSON"
"${line_to_set[$field]}"
], ],
EOM EOM
fi fi