Skip to content

fix: unify quotes to avoid bash syntax errors with empty strings#613

Merged
adrianriobo merged 1 commit into
redhat-developer:mainfrom
ppitonak:quotes_unified
Oct 1, 2025
Merged

fix: unify quotes to avoid bash syntax errors with empty strings#613
adrianriobo merged 1 commit into
redhat-developer:mainfrom
ppitonak:quotes_unified

Conversation

@ppitonak
Copy link
Copy Markdown
Collaborator

@ppitonak ppitonak commented Oct 1, 2025

  • params with default value of empty string are not evaluated correctly

It used to render script like this

if [[ create == "create" ]]; then
    cmd+="--conn-details-output /opt/host-info "
    if [[  != "" ]]; then         # notice left-hand operand missing, bash syntax error
      cmd+="--compute-sizes  "    # empty-string value not rendered which breaks mapt
    else

* params with default value of empty string are not evaluated correctly

Signed-off-by: Pavol Pitonak <ppitonak@redhat.com>
@ppitonak ppitonak requested a review from adrianriobo October 1, 2025 11:27
@ppitonak
Copy link
Copy Markdown
Collaborator Author

ppitonak commented Oct 1, 2025

Tested with AWS & RHEL

Copy link
Copy Markdown
Collaborator

@adrianriobo adrianriobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adrianriobo adrianriobo merged commit 314898f into redhat-developer:main Oct 1, 2025
7 checks passed
@ppitonak ppitonak deleted the quotes_unified branch October 1, 2025 13:36
ppitonak added a commit to ppitonak/mapt that referenced this pull request Oct 16, 2025
follow-up for redhat-developer#613 in order to avoid Bash syntax errors with empty
strings

Signed-off-by: Pavol Pitonak <ppitonak@redhat.com>
adrianriobo pushed a commit that referenced this pull request Oct 16, 2025
follow-up for #613 in order to avoid Bash syntax errors with empty
strings

Signed-off-by: Pavol Pitonak <ppitonak@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants