Module: ClaudeSwarm::SystemUtils
- Included in:
- CLI, Orchestrator, WorktreeManager
- Defined in:
- lib/claude_swarm/system_utils.rb
Instance Method Summary collapse
- #last_status ⇒ Object
- #system!(*args, **options) ⇒ Object
- #system_with_pid!(*args, **options) {|pid| ... } ⇒ Object
Instance Method Details
#last_status ⇒ Object
24 25 26 |
# File 'lib/claude_swarm/system_utils.rb', line 24 def last_status $CHILD_STATUS end |
#system!(*args, **options) ⇒ Object
5 6 7 8 |
# File 'lib/claude_swarm/system_utils.rb', line 5 def system!(*args, **) system(*args, **) handle_command_failure(last_status, args) end |
#system_with_pid!(*args, **options) {|pid| ... } ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/claude_swarm/system_utils.rb', line 10 def system_with_pid!(*args, **) # Spawn the process - by default, inherits the parent's I/O pid = Process.spawn(*args, **) # Yield the PID to the block if given yield(pid) if block_given? # Wait for the process to complete _, status = Process.wait2(pid) # Check the exit status handle_command_failure(status, args) end |