Skip to content

Instantly share code, notes, and snippets.

@alikaragoz
Created February 9, 2014 18:26
Show Gist options
  • Save alikaragoz/8903605 to your computer and use it in GitHub Desktop.
Save alikaragoz/8903605 to your computer and use it in GitHub Desktop.
xcode workspaces command line opener
#!/usr/bin/env ruby
directories = Dir.glob('*').select {
|f| File.directory? f
}
workspace = nil
directories.each do |folder|
if folder.include? ".workspace"
workspace = folder
break
elsif folder.include? ".xcodeproj"
workspace = folder
break
end
end
if workspace != nil
print "Opening #{workspace}\n"
system %{open "#{workspace}"}
else
print "No Xcode project found.\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment