Skip to content

Commit ff66049

Browse files
ci: Compute the Ruby cache key in the correct directory
Without chdir, the cache key does not respect Gemfile under npm package
1 parent d263687 commit ff66049

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rakelib/packaging.rake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def npm_pkg_rubies_cache_key(pkg)
2727
return nil unless build_command
2828
require "open3"
2929
cmd = build_command + ["--print-ruby-cache-key"]
30-
stdout, status = Open3.capture2(*cmd)
30+
chdir = pkg[:gemfile] ? File.dirname(pkg[:gemfile]) : Dir.pwd
31+
stdout, status = Open3.capture2(*cmd, chdir: chdir)
3132
unless status.success?
3233
raise "Command failed with status (#{status.exitstatus}): #{cmd.join ""}"
3334
end

0 commit comments

Comments
 (0)