Skip to content

Instantly share code, notes, and snippets.

@libdx
Created November 5, 2013 10:16
Show Gist options
  • Select an option

  • Save libdx/7316838 to your computer and use it in GitHub Desktop.

Select an option

Save libdx/7316838 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
projects = Dir.glob("*.xcworkspace") + Dir.glob("*.xcodeproj")
if projects.count > 1
puts "Choose file to open:"
projects.each_index do |i|
num = i + 1
puts "#{num}: #{projects[i]}"
end
print "> "
num = gets.chomp.to_i
if num <= 0 or num > projects.count
puts "Wrong number for project"
exit
end
project = projects[num.to_i - 1]
else
project = projects.first
end
`open "#{project}"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment