@antora/cli 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +9 -2
- package/package.json +4 -4
package/lib/cli.js
CHANGED
|
@@ -13,7 +13,6 @@ async function run (argv = process.argv) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function exitWithError (err, opts, msg = undefined) {
|
|
16
|
-
const { getLogger, configureLogger } = requireLogger()
|
|
17
16
|
let errMessage = String(
|
|
18
17
|
err instanceof Error ? err.message : Object.assign((err = new Error(String(err))), { stack: undefined }).message
|
|
19
18
|
)
|
|
@@ -21,6 +20,8 @@ function exitWithError (err, opts, msg = undefined) {
|
|
|
21
20
|
? (errMessage = errMessage.slice(21)) && 'asciidoctor'
|
|
22
21
|
: cli.name()
|
|
23
22
|
if (!msg) msg = errMessage
|
|
23
|
+
const { configureLogger, getLogger } = requireLogger()
|
|
24
|
+
if (!getLogger) return lastDitchExit(err, msg)
|
|
24
25
|
if (!getLogger(null)) {
|
|
25
26
|
configureLogger({ format: 'pretty', level: opts.silent ? 'silent' : 'fatal', failureLevel: 'fatal' })
|
|
26
27
|
}
|
|
@@ -38,6 +39,12 @@ function exit () {
|
|
|
38
39
|
.then((failOnExit) => process.exitCode || (process.exitCode = failOnExit ? 1 : 0))
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
function lastDitchExit (err, msg) {
|
|
43
|
+
if (msg !== err.message) console.error(msg)
|
|
44
|
+
console.error(err)
|
|
45
|
+
process.exitCode = process.exitCode || 1
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
function getTTYColumns () {
|
|
42
49
|
return +process.env.COLUMNS || process.stdout.columns || 80
|
|
43
50
|
}
|
|
@@ -53,7 +60,7 @@ function requireLogger (fromPath = undefined, moduleName = '@antora/logger') {
|
|
|
53
60
|
(requireLogger.cache = fromPath ? userRequire(moduleName, { paths: [fromPath] }) : require(moduleName))
|
|
54
61
|
) // dynamic require('@antora/logger')
|
|
55
62
|
} catch {
|
|
56
|
-
return fromPath
|
|
63
|
+
return fromPath ? (requireLogger.cache = require(moduleName)) : {}
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
66
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antora/cli",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "The command line interface for Antora.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "OpenDevise Inc. (https://opendevise.com)",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"antora": "bin/antora"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@antora/logger": "3.1.
|
|
29
|
-
"@antora/playbook-builder": "3.1.
|
|
28
|
+
"@antora/logger": "3.1.1",
|
|
29
|
+
"@antora/playbook-builder": "3.1.1",
|
|
30
30
|
"@antora/user-require-helper": "~2.0",
|
|
31
31
|
"commander": "~9.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@antora/site-publisher": "3.1.
|
|
34
|
+
"@antora/site-publisher": "3.1.1",
|
|
35
35
|
"@asciidoctor/core": "~2.2",
|
|
36
36
|
"convict": "~6.2",
|
|
37
37
|
"kapok-js": "~0.10"
|