Skip to content

Commit b69e665

Browse files
committed
fix: handle logging step
1 parent 153012c commit b69e665

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

lib/output.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,22 @@ module.exports = {
115115
}
116116
}
117117

118-
let stepLine = step.toCliStyled()
119-
if (step.metaStep && outputLevel >= 1) {
120-
// this.stepShift += 2;
121-
stepLine = colors.dim(truncate(stepLine, this.spaceShift))
122-
}
123-
if (step.comment) {
124-
stepLine += colors.grey(step.comment.split('\n').join('\n' + ' '.repeat(4)))
125-
}
118+
try {
119+
let stepLine = step.toCliStyled()
120+
if (step.metaStep && outputLevel >= 1) {
121+
// this.stepShift += 2;
122+
stepLine = colors.dim(truncate(stepLine, this.spaceShift))
123+
}
124+
if (step.comment) {
125+
stepLine += colors.grey(step.comment.split('\n').join('\n' + ' '.repeat(4)))
126+
}
126127

127-
const _stepLine = isMaskedData() ? maskSensitiveData(stepLine) : stepLine
128-
print(' '.repeat(this.stepShift), truncate(_stepLine, this.spaceShift))
128+
const _stepLine = isMaskedData() ? maskSensitiveData(stepLine) : stepLine
129+
print(' '.repeat(this.stepShift), truncate(_stepLine, this.spaceShift))
130+
} catch (e) {
131+
// sometimes the step is just the string, so we basically print it out
132+
print(step)
133+
}
129134
},
130135

131136
/** @namespace */

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
".": "./lib/index.js",
3434
"./els": "./lib/els.js",
3535
"./effects": "./lib/effects.js",
36-
"./steps": "./lib/steps.js"
36+
"./steps": "./lib/steps.js",
37+
"./step": "./lib/step.js"
3738
},
3839
"types": "typings/index.d.ts",
3940
"bin": {

0 commit comments

Comments
 (0)