Class: Kompo::InstallDeps::ForMacOS::InstallReadline::Install
- Inherits:
-
Taski::Task
- Object
- Taski::Task
- Kompo::InstallDeps::ForMacOS::InstallReadline::Install
- Defined in:
- lib/kompo/tasks/install_deps.rb
Instance Method Summary collapse
Instance Method Details
#clean ⇒ Object
149 150 151 152 153 154 155 156 |
# File 'lib/kompo/tasks/install_deps.rb', line 149 def clean return unless File.exist?(MARKER_FILE) brew = HomebrewPath.path puts "Uninstalling #{BREW_NAME} (installed by kompo)..." system("#{brew} uninstall #{BREW_NAME}") File.delete(MARKER_FILE) if File.exist?(MARKER_FILE) end |
#run ⇒ Object
139 140 141 142 143 144 145 146 147 |
# File 'lib/kompo/tasks/install_deps.rb', line 139 def run brew = HomebrewPath.path puts "Installing #{BREW_NAME}..." system("#{brew} install #{BREW_NAME}") or raise "Failed to install #{BREW_NAME}" File.write(MARKER_FILE, "installed") prefix = `#{brew} --prefix #{BREW_NAME} 2>/dev/null`.chomp @lib_path = "-L#{prefix}/lib" if $CHILD_STATUS.success? && !prefix.empty? end |