Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 16 lines (11 sloc) 417 Bytes
#! /usr/bin/env ruby
XCODE_PATH = File.expand_path(File.join(`xcode-select -p`.chomp, '../..'))
def open_cmd(pattern)
files = Dir.glob(pattern)
`open -a "#{XCODE_PATH}" "#{files.first}"` and exit if files.count == 1
end
open_cmd '*.xcworkspace'
open_cmd '*.xcodeproj'
open_cmd '*.playground'
open_cmd '.' if File.exists?('Package.swift')
puts 'No Xcode workspaces, projects, playgrounds, or packages found.'
You can’t perform that action at this time.