Last active
November 11, 2015 03:38
-
-
Save ayanonagon/85ae473b27526616a612 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let cocoaPodsDir = "Pods/" | |
let carthageDir = "Carthage/Checkouts/" | |
let options: NSDirectoryEnumerationOptions = [.SkipsPackageDescendants, .SkipsHiddenFiles] | |
let fileManager = NSFileManager.defaultManager() | |
guard | |
let cocoaPodsDirURL = NSURL(string: cocoaPodsDir), | |
let cocoaPodsEnumerator = fileManager.enumeratorAtURL(cocoaPodsDirURL, includingPropertiesForKeys: nil, options: options, errorHandler: nil) | |
else { | |
print("Error: \(cocoaPodsDir) directory not found. Please run `rake`") | |
return | |
} | |
guard | |
let carthageDirURL = NSURL(string: carthageDir), | |
let carthageEnumerator = fileManager.enumeratorAtURL(carthageDirURL, includingPropertiesForKeys: nil, options: options, errorHandler: nil) | |
else { | |
print("Error: \(carthageDir) directory not found. Please run `rake`") | |
return | |
} | |
guard | |
let cocoaPodsURLs = cocoaPodsEnumerator.allObjects as? [NSURL], | |
let carthageURLs = carthageEnumerator.allObjects as? [NSURL] | |
else { | |
print("Unexpected error: Enumerator contained item that is not NSURL.") | |
return | |
} | |
let allURLs = cocoaPodsURLs + carthageURLs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment