From 743718ef3fa60ee9feb81112ffe931d8f3f463bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtek=20Meloun?= Date: Sat, 18 Apr 2026 11:18:15 +0200 Subject: [PATCH 1/2] Use the active Ruby environment for configured checks Configured commands should run in the same environment that launched `gotsha`. Re-entering a login shell can change PATH and Ruby selection, which is reproducible on macOS and made `rubocop` fail with a gem lookup error. --- lib/gotsha/bash_command.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gotsha/bash_command.rb b/lib/gotsha/bash_command.rb index a40f7004..ee38821e 100644 --- a/lib/gotsha/bash_command.rb +++ b/lib/gotsha/bash_command.rb @@ -18,7 +18,7 @@ def self.run!(command) exit_code = nil # This block is an ugly workaround to ensure the color output is stored both on Linux and Mac - PTY.spawn("bash", "-lc", "#{command}; printf \"\\n#{MARKER}%d\\n\" $?") do |r, _w, pid| + PTY.spawn("bash", "-c", "#{command}; printf \"\\n#{MARKER}%d\\n\" $?") do |r, _w, pid| r.each do |line| if line.start_with?(MARKER) exit_code = line.sub(MARKER, "").to_i From 107a851aa6880c054630b6917221323d73086eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtek=20Meloun?= Date: Sat, 18 Apr 2026 11:37:54 +0200 Subject: [PATCH 2/2] Run Gotsha