Comments (6)
I published v1.14.0
- https://github.com/itamae-kitchen/itamae/blob/master/CHANGELOG.md#v1140
- https://rubygems.org/gems/itamae/versions/1.14.0
from itamae.
@mishina2228 Thank you for reporting! I'll check that behavior in a few days...
from itamae.
@mishina2228 Sorry for the late reply.
I'm not deeply investigate yet, the root cause is evaluate "local_ruby_block" by itamae's process, so this working directory is not changed, it's the reason why "cwd" attribute is not work correctly.
This patch fixes the problem but I'm worried about this change might cause a large breaking change...
diff --git a/lib/itamae/resource/local_ruby_block.rb b/lib/itamae/resource/local_ruby_block.rb
index 54c9342..ca880d3 100644
--- a/lib/itamae/resource/local_ruby_block.rb
+++ b/lib/itamae/resource/local_ruby_block.rb
@@ -5,7 +5,9 @@ module Itamae
define_attribute :block, type: Proc
def action_run(options)
- attributes.block.call
+ Dir.chdir(attributes[:cwd]) do
+ attributes.block.call
+ end
end
end
end
@sue445 How do you think?
from itamae.
@unasuke Thank you for your research.
I think I am good to go as long as all existing tests pass.
If you're worried, you could release the gem in rc
version and see what happens.
from itamae.
I couldn't find public itamae recipes that use "local_ruby_block" with "cwd".
https://github.com/search?q=language%3Aruby+local_ruby_block&type=code
So I thought the change is breaking, but not huge impact. (Although I will make rc release)
from itamae.
I found (maybe) the same issue on mitamae.
from itamae.
Related Issues (20)
- Use the package resource to install Homebrew casks? HOT 1
- not_if is confusing when cwd is specified with a directory that does not exist
- Logical issue with creating users with passwords and updating passwords for users on Linux
- Mash#disable_warnings with `CannotDisableMashWarnings` guard on base class is annoying HOT 3
- `remote_file` resource fails when specifying `user` attribute different from execution user. HOT 1
- Updated Slack Invite Link? HOT 2
- Capturing local variable `context` doesn't work HOT 1
- Chained notifies don't work when the notifies are defined in different recipes
- 'itamae docker' fails on remote_file resource when the image is created with non-root user HOT 2
- 'itamae docker' fails on template resource when user is specified HOT 2
- failed chmod when already executed itamae by other user with --no-sudo HOT 3
- CI doesn't work on Itamae repo
- Why not install ohai as a gem? HOT 2
- Thor Deprecation warning HOT 1
- `load_recipes': undefined method `each' for String (NoMethodError) HOT 4
- Itamae doesn't raise an error when private-key-file doesn't exist HOT 4
- Feature: include library files by default HOT 2
- Template: `source: auto` but with non-matching name HOT 2
- How to add a user to multiple groups? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itamae.