Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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

This comment has been minimized.

Copy link

@Que20 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

This comment has been minimized.

Copy link
Owner Author

@orkoden orkoden commented Jan 9, 2014

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

@eugenpirogoff

This comment has been minimized.

Copy link

@eugenpirogoff eugenpirogoff commented Jul 21, 2015

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