envs_user_info.sh: fix remove leading and trailing string

This commit is contained in:
creme 2021-12-08 10:55:50 +01:00
parent a5653d56d6
commit 8d414b6b05
Signed by: creme
GPG Key ID: C147C3B7FBDF08D0
1 changed files with 2 additions and 0 deletions

View File

@ -96,6 +96,8 @@ EOM
# desc
if [ -f "$INFO_FILE" ]; then
desc="$(sed -n '/^desc=/{s#^.*=##;p}' "$INFO_FILE")"
# remove leading and trailing `"`
desc="$(echo "$desc" | sed -e '$ s/^"//' -e '$ s/"$//')"
if [ -z "$desc" ] || [ "$desc" == 'a short describtion or message' ]; then
cat << EOM >> "$TMP_JSON"
"desc": "",