Skip to content

Instantly share code, notes, and snippets.

@marcelofabri
Last active July 11, 2016 21:34
Show Gist options
  • Save marcelofabri/5480591 to your computer and use it in GitHub Desktop.
Save marcelofabri/5480591 to your computer and use it in GitHub Desktop.
Open .xcworkspace file if exists or .xcodeproj otherwise. Useful for CocoaPods users. Found it elsewhere, but I can't find it anymore.
#!/usr/bin/env ruby
require 'shellwords'
proj = Dir['*.xcworkspace'].first
proj = Dir['*.xcodeproj'].first unless proj
if proj
puts "Opening #{proj}"
`open #{proj}`
else
puts "No xcworkspace|xcproj file found"
end
@fpg1503
Copy link

fpg1503 commented Jul 11, 2016

This is currently under paulomendes/xopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment