Execute local_ruby_block code inside of chdir-ed block if cwd presented #122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
"local_ruby_block" execute by itamae's ruby process. The process doesn't change its working directory, which is presented by "cwd" attribute.
I think it's the root cause of itamae's issue itamae-kitchen/itamae#353
I made the local_ruby_block code execute inside of Dir.chdir block if cwd attribute was presented to fix it.
This behavior has existed since 2015 (in itamae itamae-kitchen/itamae#146, not mitamae).
There might be a recipe that is dependent on current behavior somewhere.
Although I couldn't find public itamae recipes that use "local_ruby_block" with "cwd", the change has a small impact, I think.
ref itamae-kitchen/itamae#355
@k0kubun how do you think?