mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
Add newlines to gensite errors
This commit is contained in:
parent
93a9f5b403
commit
9e7bbcab5a
1 changed files with 4 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ import samhuri_net
|
|||
|
||||
guard CommandLine.arguments.count >= 3 else {
|
||||
let name = CommandLine.arguments[0]
|
||||
fputs("Usage: \(name) <site dir> <target dir>", stderr)
|
||||
fputs("Usage: \(name) <site dir> <target dir>\n", stderr)
|
||||
exit(1)
|
||||
}
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ let sourcePath = CommandLine.arguments[1]
|
|||
var isDir: ObjCBool = false
|
||||
let sourceExists = FileManager.default.fileExists(atPath: sourcePath, isDirectory: &isDir)
|
||||
guard sourceExists, isDir.boolValue else {
|
||||
fputs("error: Site path \(sourcePath) does not exist or is not a directory", stderr)
|
||||
fputs("error: Site path \(sourcePath) does not exist or is not a directory\n", stderr)
|
||||
exit(2)
|
||||
}
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ let siteURLOverride: URL?
|
|||
if CommandLine.argc > 3, CommandLine.arguments[3].isEmpty == false {
|
||||
let urlString = CommandLine.arguments[3]
|
||||
guard let url = URL(string: urlString) else {
|
||||
print("error: invalid site URL \(urlString)")
|
||||
fputs("error: invalid site URL \(urlString)\n", stderr)
|
||||
exit(4)
|
||||
}
|
||||
siteURLOverride = url
|
||||
|
|
@ -45,6 +45,6 @@ do {
|
|||
exit(0)
|
||||
}
|
||||
catch {
|
||||
fputs("error: \(error)", stderr)
|
||||
fputs("error: \(error)\n", stderr)
|
||||
exit(-1)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue