Skip to content

Commit

Permalink
ruby gem: invoke overmind using exec (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
prog-supdex authored Apr 5, 2024
1 parent a990724 commit 9285405
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packaging/rubygems/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
overmind (0.1.2)
overmind (2.5.1)

GEM
remote: https://rubygems.org/
Expand Down
3 changes: 1 addition & 2 deletions packaging/rubygems/bin/overmind
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ require 'overmind/cli'

begin
cli = Overmind::CLI.new
exit_code = cli.run(ARGV)
exit exit_code
cli.run(ARGV)
rescue StandardError => e
warn e.message
exit 1
Expand Down
8 changes: 2 additions & 6 deletions packaging/rubygems/lib/overmind/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ def run(args = [])
# Use prebuild tmux if found
path_with_tmux = File.exist?(TMUX_PATH) ? "#{TMUX_FOLDER_PATH}:#{ENV["PATH"]}" : ENV["PATH"]

# Spawns the Overmind process with modified PATH if necessary
pid = spawn({"PATH" => path_with_tmux}, "#{OVERMIND_PATH} #{args.join(" ")}")

Process.wait(pid)

$?.exitstatus
# exec the Overmind process with modified PATH if necessary
exec({"PATH" => path_with_tmux}, "#{OVERMIND_PATH} #{args.join(" ")}")
end

private
Expand Down
2 changes: 1 addition & 1 deletion packaging/rubygems/lib/overmind/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Overmind
VERSION = "2.5.0"
VERSION = "2.5.1"
end

0 comments on commit 9285405

Please sign in to comment.