Skip to content

Instantly share code, notes, and snippets.

@orkoden
Last active October 30, 2018 06:17
Show Gist options
  • Save orkoden/7010433 to your computer and use it in GitHub Desktop.
Save orkoden/7010433 to your computer and use it in GitHub Desktop.
# run with
# ruby reallyCleanXcode.rb
derivedDataFolder = Dir.glob(Dir.home + "/Library/Developer/Xcode/DerivedData/*")
moduleCache = Dir.glob("/var/folders/**/com.apple.DeveloperTools*")
FileUtils.rm_rf derivedDataFolder + moduleCache
@Que20
Copy link

Que20 commented Nov 26, 2013

sh-3.2# ruby reallyCleanXcode.rb 
reallyCleanXcode.rb:4: syntax error, unexpected **arg
moduleCache = Dir.glob("/var/folders/**/com.apple.DeveloperTools*”)
                                       ^
reallyCleanXcode.rb:4: unterminated regexp meets end of file

... :/
What can I do ?

@orkoden
Copy link
Author

orkoden commented Jan 9, 2014

Your quotes seem to be incorrect. The second one seems to be a instead of a ".

@eugenpirogoff
Copy link

suggesting this changes and additional chmod +x filename.rb for ./filename.rb usage

#!/usr/bin/env ruby
require 'fileutils'
derivedDataFolder = Dir.glob(Dir.home + "/Library/Developer/Xcode/DerivedData/*")
moduleCache = Dir.glob("/var/folders/**/com.apple.DeveloperTools*")
FileUtils.rm_rf derivedDataFolder + moduleCache

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