Module: RubyProgress::ShellExec
- Defined in:
- lib/ruby-progress/output_capture.rb
Overview
Shell execution helpers for spawning commands within a PTY
Class Method Summary collapse
-
.build_shell_argv(shell, command) ⇒ Array<String>
Build argv for invoking the user’s shell with a command string.
Class Method Details
.build_shell_argv(shell, command) ⇒ Array<String>
Build argv for invoking the user’s shell with a command string. Uses login shells so aliases/functions and environment are available.
26 27 28 29 30 31 32 33 34 |
# File 'lib/ruby-progress/output_capture.rb', line 26 def build_shell_argv(shell, command) shell_name = File.basename(shell) case shell_name when 'fish' ['-l', '-c', command] else ['-lc', command] end end |