         static let Magenta = "\u{001B}[0;35m"
         static let Cyan = "\u{001B}[0;36m"
         static let White = "\u{001B}[0;37m"
+        static let DarkGray = "\u{001B}[1;30m"
     }
     
     // MARK: - Properties
     
     let fileManager = FileManager.default
+    var processedPaths = [String]()
     
     let oldName: String
     let newName: String

    
    // MARK: - Helpers
    
    private func handleUnitTests() {
        print("\n\(Color.Magenta)--- [Unit Tests]")
        enumerateCurrentPath(appendingPathComponent: "\(oldName) Tests")
    }
    
    private func handleUITests() {
        print("\n\(Color.Magenta)--- [UI Tests]")
        enumerateCurrentPath(appendingPathComponent: "\(oldName) UITests")
    }
    
    private func handleMainTarget() {
        print("\n\(Color.Magenta)--- [Main Target]")
        enumerateCurrentPath(appendingPathComponent: oldName)
    }
    
    private func handleProjectFile() {
        print("\n\(Color.Magenta)--- [Project File]")
        enumerateCurrentPath(appendingPathComponent: "\(oldName).xcodeproj")
    }
    
    private func enumerateCurrentPath(appendingPathComponent pathComponent: String) {
        let currentPath = fileManager.currentDirectoryPath
        let path = currentPath.appending("/\(pathComponent)/")
        
        enumerateDirectory(atPath: path)
        renameItem(atPath: path)
    }
    
    private func enumerateDirectory(atPath path: String) {
        print("\n\(Color.Yellow)- DIRECTORY: \(path)")
        
        let enumerator = fileManager.enumerator(atPath: path)
        
        while let element = enumerator?.nextObject() as? String {
            if !shouldSkip(element) {
                let itemPath = path.appending(element)
                
                var isDir: ObjCBool = false
                if fileManager.fileExists(atPath: itemPath, isDirectory: &isDir) {
                    if !isDir.boolValue {
                        updateContentsOfFile(atPath: itemPath)
                    }
                }

                renameItem(atPath: itemPath)
            }
        }
    }
    
    private func shouldSkip(_ element: String) -> Bool {
        guard !element.contains(".DS_Store") else { return true }
        
        let fileExtension = URL(fileURLWithPath: element).pathExtension
        switch fileExtension {

    }
    
    private func updateContentsOfFile(atPath path: String) {
        do {
            let oldContent = try String(contentsOfFile: path, encoding: .utf8)
            if oldContent.contains(oldName) {
                let newContent = oldContent.replacingOccurrences(of: oldName, with: newName)
                try newContent.write(toFile: path, atomically: true, encoding: .utf8)
                print("\(Color.Blue)-- Updated: \(path)")
            }
        } catch {
            print("\(Color.Red)Error while updating file: \(error.localizedDescription)\n")
        }
    }
    
    private func renameItem(atPath path: String) {
        do {
            let oldItemName = URL(fileURLWithPath: path).lastPathComponent
            if oldItemName.contains(oldName) {
                let newItemName = oldItemName.replacingOccurrences(of: oldName, with: newName)
                let directoryURL = URL(fileURLWithPath: path).deletingLastPathComponent()
                let newPath = directoryURL.appendingPathComponent(newItemName).path
                try fileManager.moveItem(atPath: path, toPath: newPath)
                print("\(Color.Magenta)-- Renamed: \(oldItemName) -> \(newItemName)")
            }
        } catch {
            print("\(Color.Red)Error while renaming file: \(error.localizedDescription)")
        }
    }
    
}

let arguments = CommandLine.arguments
if arguments.count == 3 {
    let oldName = arguments[1]
    let newName = arguments[2].replacingOccurrences(of: " ", with: "")
