Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReplaceRunKeywordIf should remove unnecessary ELSE branch #192

Closed
bhirsz opened this issue Sep 7, 2021 · 0 comments · Fixed by #196
Closed

ReplaceRunKeywordIf should remove unnecessary ELSE branch #192

bhirsz opened this issue Sep 7, 2021 · 0 comments · Fixed by #196
Labels
enhancement New feature or request

Comments

@bhirsz
Copy link
Member

bhirsz commented Sep 7, 2021

This 'trick' was used to overwrite some variable with keyword value under some condition:

    ${variable}    Run Keyword If    ${something}
    ...    Catenate    ${variable}    sed -i 's/substring/${OTHER}calc/' file.conf ;
    ...    ELSE    Set Variable    ${variable}

While converting it to IF we end up with:

IF    ${something}
    ${variable}    Catenate    ${variable}    sed -i 's/substring/${OTHER}calc/' file.conf ;
ELSE
    ${variable}    Set Variable    ${variable}
END

while it could be just:

IF    ${something}
    ${variable}    Catenate    ${variable}    sed -i 's/substring/${OTHER}calc/' file.conf ;
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant