Giter VIP home page Giter VIP logo

Comments (6)

unasuke avatar unasuke commented on May 24, 2024 2

I published v1.14.0

from itamae.

unasuke avatar unasuke commented on May 24, 2024 1

@mishina2228 Thank you for reporting! I'll check that behavior in a few days...

from itamae.

unasuke avatar unasuke commented on May 24, 2024 1

@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.

sue445 avatar sue445 commented on May 24, 2024 1

@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.

unasuke avatar unasuke commented on May 24, 2024 1

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.

unasuke avatar unasuke commented on May 24, 2024

I found (maybe) the same issue on mitamae.

from itamae.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.