Skip to content

Commit 16f2cd3

Browse files
committed
Use console.error to report errors
Nicer, hopefully uses stderr ;-)
1 parent 2716777 commit 16f2cd3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/servedocc/main.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ let indexPath = archivePath + "/index.html"
2929
let docPath = archivePath + "/data/documentation"
3030

3131
guard fs.existsSync(archivePath) else {
32-
print("Specified file does not exist:", archivePath)
32+
console.error("Specified file does not exist:", archivePath)
3333
process.exit(2)
3434
}
3535
guard fs.existsSync(indexPath), fs.existsSync(docPath) else {
36-
print("File does not look like a DocC archive:", archivePath)
36+
console.error("File does not look like a DocC archive:", archivePath)
3737
process.exit(3)
3838
}
3939

4040
guard let dataIndex = (try? fs.readdirSync(docPath))?
4141
.first(where: { $0.hasSuffix(".json")} )
4242
else {
43-
print("File does not look like a DocC archive, missing data index:",
44-
archivePath)
43+
console.error("File does not look like a DocC archive, missing data index:",
44+
archivePath)
4545
process.exit(3)
4646
}
4747
let dataIndexPath = docPath + "/" + dataIndex

0 commit comments

Comments
 (0)