@modernpoacher/deps 2.1.6 → 2.1.8
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/bin/common/index.mjs +10 -5
- package/bin/deps/execute.mjs +1 -9
- package/package.json +1 -1
package/bin/common/index.mjs
CHANGED
|
@@ -95,19 +95,24 @@ export function use (key) {
|
|
|
95
95
|
const log = debug(`@modernpoacher/deps:${key}`)
|
|
96
96
|
|
|
97
97
|
return function use (v) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
if (v.includes('\n')) v.split('\n').map((s) => trim(s)).filter(Boolean).forEach((s) => log(s))
|
|
99
|
+
else {
|
|
100
|
+
const s = v.trim()
|
|
101
|
+
if (s !== '') log(trim(s))
|
|
102
|
+
}
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
export function handleError (e = {}) {
|
|
105
107
|
const {
|
|
106
|
-
code = CODE
|
|
107
|
-
message = MESSAGE
|
|
108
|
+
code = CODE
|
|
108
109
|
} = e
|
|
109
110
|
|
|
110
111
|
if (code > 1) error(code)
|
|
112
|
+
const {
|
|
113
|
+
message = MESSAGE
|
|
114
|
+
} = e
|
|
115
|
+
|
|
111
116
|
error(message)
|
|
112
117
|
}
|
|
113
118
|
|
package/bin/deps/execute.mjs
CHANGED
|
@@ -67,15 +67,7 @@ function handleCommandError (e) {
|
|
|
67
67
|
code = 0
|
|
68
68
|
} = e
|
|
69
69
|
|
|
70
|
-
if (code !== 128)
|
|
71
|
-
const {
|
|
72
|
-
message
|
|
73
|
-
} = e
|
|
74
|
-
|
|
75
|
-
const log = debug('@modernpoacher/deps:error')
|
|
76
|
-
if (code > 1) log(code)
|
|
77
|
-
log(message)
|
|
78
|
-
}
|
|
70
|
+
if (code !== 128) handleError(e)
|
|
79
71
|
}
|
|
80
72
|
|
|
81
73
|
async function getDefaultBranch (directory) {
|