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

Always use local variables when storing the options to prevent overri… #754

Merged
merged 8 commits into from
Aug 9, 2024

Conversation

Grifs
Copy link
Collaborator

@Grifs Grifs commented Aug 5, 2024

…ding in sub functions

Describe your changes

Use local consistently when executing save=$-; set +e in the bash wrapper.
Essentially, the -e option wasn't being set again.

To give a more clear explanation of what's going on:

function foo2 {
	foo="foo2"
	echo "foo2: $foo"
}

function foo1 {
	local foo="foo1"
	foo2
	echo "foo1: $foo"
}

foo="foo"
foo1
echo "foo: $foo"

results in:

foo2: test2
foo1: test2
test: test

Related issue(s)

Closes #753

Type of Change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New functionality (non-breaking change which adds functionality)
  • Major change (non-breaking change which modifies existing functionality)
  • Minor change (non-breaking change which does not modify existing functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

Checklist

Requirements:

  • I have read the CONTRIBUTING doc.
  • I have performed a self-review of my code by checking the "Changed Files" tab.
  • My code follows the code style of this project.

Tests:

  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Documentation:

  • Proposed changes are described in the CHANGELOG.md.
  • I have updated the documentation accordingly.

Test Environment

@Grifs Grifs requested a review from rcannood August 5, 2024 13:06
Copy link
Member

@rcannood rcannood left a comment

Choose a reason for hiding this comment

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

Could you

  • Add a test
  • Add local to all local variables in the bash functions

Not sure how I somehow missed this in the first place

@Grifs
Copy link
Collaborator Author

Grifs commented Aug 9, 2024

Could you

  • Add a test
  • Add local to all local variables in the bash functions

Not sure how I somehow missed this in the first place

yes, yes. working on it.

@Grifs Grifs requested a review from rcannood August 9, 2024 10:34
Copy link
Member

@rcannood rcannood left a comment

Choose a reason for hiding this comment

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

minor suggestion, otherwise LGTM!

@Grifs Grifs merged commit 25e9bf4 into develop Aug 9, 2024
7 checks passed
@Grifs Grifs deleted the fix/bashwrapper_side_effects_during_build branch August 9, 2024 12:42
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