         fail("Could not remove archive '\(archive)'")
     }
 
-    print("Done.")
+    print("Vapor CLI successfully installed in \(target)")
 }
 
 // main

    return "https://github.com/qutheory/\(repository)/archive/\(branch).tar.gz"
}

//func install(source: String, target: String) throws {
////    S_IWUSR
//    do {
//        try run("mv \(from) \(to)")
//    } catch {
//        try run("sudo mv \(from) \(to)")
//    }
//}

func bootstrap(repository: String, branch: String, targetDir: String) {
    guard isDir(path: targetDir) else {

    cmd.append(url)
    cmd.append(contentsOf: ["-o", output])
    try run(cmd)
}

func wget(url: String, output: String, verbose: Bool = false) throws {
    guard hasCommand("wget") else {
        throw Error.commandNotFound
    }

    var cmd = ["wget"]
    if !verbose {
        cmd.append("-q")
    }
    cmd.append(url)
    cmd.append(contentsOf: ["-O", output])
    try run(cmd)
}

func download(url: String, output: String, verbose: Bool = false, followRedirect: Bool = true) throws {
    do {
        try curl(url: url, output: output, verbose: verbose, followRedirect: followRedirect)
    } catch Error.commandNotFound {
        // curl may not be available
        try wget(url: url, output: output, verbose: verbose)
    }
}

func unpack(archive: String, verbose: Bool = false) throws {
