Skip to content

Commit

Permalink
Add update command for refreshing cached list.
Browse files Browse the repository at this point in the history
  • Loading branch information
neonichu committed Apr 14, 2015
1 parent ccd4a41 commit cfd7a50
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/xcode/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def list
list_versions.join("\n")
end

def rm_list_cache
FileUtils.rm_f(LIST_FILE)
end

def symlink(version)
xcode = installed_versions.select { |x| x.version == version }.first
`sudo rm -f #{SYMLINK_PATH}` unless current_symlink.nil?
Expand Down
1 change: 1 addition & 0 deletions lib/xcode/install/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Command < CLAide::Command
require "xcode/install/installed"
require "xcode/install/list"
require "xcode/install/uninstall"
require "xcode/install/update"

self.abstract_command = true
self.command = 'xcode-install'
Expand Down
14 changes: 14 additions & 0 deletions lib/xcode/install/update.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module XcodeInstall
class Command
class Update < Command
self.command = 'update'
self.summary = 'Update cached list of available Xcodes.'

def run
installer = XcodeInstall::Installer.new
installer.rm_list_cache
installer.list
end
end
end
end

0 comments on commit cfd7a50

Please sign in to comment.