Class: RocketFuel::Fix::CommandLineTools::Install

Inherits:
Object
  • Object
show all
Defined in:
lib/rocket_fuel/fix/command_line_tools/install.rb

Instance Method Summary collapse

Constructor Details

#initialize(dmg_path) ⇒ Install

Returns a new instance of Install.



7
8
9
10
# File 'lib/rocket_fuel/fix/command_line_tools/install.rb', line 7

def initialize(dmg_path)
  @dmg_path = dmg_path
   = .new(dmg_path)
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
# File 'lib/rocket_fuel/fix/command_line_tools/install.rb', line 12

def run
  #sudo before the work needs to be done to improve clarity of prompt
  `sudo echo `
  `echo Y | PAGER=true hdiutil attach '#{@dmg_path}' -quiet `
  `sudo installer -pkg '/Volumes/#{volumes_dir}/#{pkg_name}.pkg' -target /`
  `hdiutil detach '/Volumes/#{volumes_dir}' || hdiutil detach '/Volumes/#{volume_dir}' -force`
end