Module: CommandHelper

Included in:
CreateNewLogins, NameDisplay, ReleaseProject, UpgradeLaptopExecution, UpgradeMacOS
Defined in:
lib/renuo/cli/app/command_helper.rb

Instance Method Summary collapse

Instance Method Details

#open_path(path) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/renuo/cli/app/command_helper.rb', line 9

def open_path(path)
  system_command = case RbConfig::CONFIG["host_os"]
                   when /mswin|mingw|cygwin/
                     "start"
                   when /darwin/
                     "open"
                   when /linux|bsd/
                     "xdg-open"
                   end
  run_command "#{system_command} #{path}"
end

#run_command(command) ⇒ Object



4
5
6
7
# File 'lib/renuo/cli/app/command_helper.rb', line 4

def run_command(command)
  say "\n#{command.yellow}"
  system command
end