   installTemplate(templateName)
 }
 
-
 /// Copy template to selected target path
 func installTemplate(_ templateName: String) {
-  
   // Print Target Directory Path
   print("Select Directory Path to Install Template")
   print(String(repeating: "#", count:40))
   print("1: Custom File Template")
   print("2: Xcode File Template (admin only)")
   print(String(repeating: "#", count:40), terminator: "\n\n")
-  
-  
+
   // Select Target Base Path
   let userHomeDirectory = "/Users/".appending(bash(command: "whoami", arguments: []))
   let xcodeBasePath = bash(command: "xcode-select", arguments: ["--print-path"])

    break
  }
  
  
  let filePath = directoryPath.appending("/\(templateName)")
  let _ = bash(command: "mkdir", arguments: ["-p", directoryPath])
  
  copyTemplate(from: templateName, to: filePath)
}


///
func copyTemplate(from: String, to: String) {
  do {
    printInConsole(".....")
    defer { print() }
    
    if !fileManager.fileExists(atPath: to){
      try fileManager.copyItem(atPath: from, toPath: to)
      
      printInConsole("Template installed succesfully.")
      
    }
    else{
      try _ = fileManager.removeItem(atPath: to)
      try fileManager.copyItem(atPath: from, toPath: to)
      
      printInConsole("Template has been replaced succesfully.")
    }
  }
  catch let error as NSError {
    printInConsole("Ooops! Something went wrong: \(error.localizedFailureReason!)")
  }
}


/// Bash Shell Command
func bash(command: String, arguments: [String]) -> String {

    .contentsOfDirectory(atPath: ".")
    .filter { $0.hasSuffix(".xctemplate") }
  
  guard let templates = templateChecker, !templates.isEmpty else {
    printInConsole("xctemplate directory does not exist")
    return
  }
