Sha256: 6d0d0e1ddefd1a6bc37777763ca1c62dc33a61a85519556745a6fec3bf7e4082

Contents?: true

Size: 772 Bytes

Versions: 6

Compression:

Stored size: 772 Bytes

Contents

module XcodeInstall
  class Command
    class Select < Command
      self.command = 'select'
      self.summary = 'Select installed Xcode via `xcode-select`.'

      self.arguments = [
        CLAide::Argument.new('VERSION', :true)
      ]

      def initialize(argv)
        @installer = Installer.new
        @version = argv.shift_argument
        super
      end

      def validate!
        super

        fail Informative, "Please specify a version to select." if @version.nil?
        fail Informative, "Version #{@version} not installed." unless @installer.installed?(@version)
      end

      def run
        xcode = @installer.installed_versions.detect { |v| v.version == @version }
        `sudo xcode-select --switch #{xcode.path}`
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
xcode-install-1.1.0 lib/xcode/install/select.rb
xcode-install-1.0.1 lib/xcode/install/select.rb
xcode-install-1.0.0 lib/xcode/install/select.rb
xcode-install-0.9.6 lib/xcode/install/select.rb
xcode-install-0.9.5 lib/xcode/install/select.rb
xcode-install-0.9.4 lib/xcode/install/select.rb