Skip to content

Commit

Permalink
improve the step output handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Jan 20, 2025
1 parent 9140b90 commit 981ddb1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/output.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const colors = require('chalk')
const figures = require('figures')
const { maskSensitiveData } = require('invisi-data')
const Step = require('./step')

const styles = {
error: colors.bgRed.white.bold,
Expand Down Expand Up @@ -115,7 +116,7 @@ module.exports = {
}
}

try {
if (step instanceof Step) {
let stepLine = step.toCliStyled()
if (step.metaStep && outputLevel >= 1) {
// this.stepShift += 2;
Expand All @@ -127,9 +128,11 @@ module.exports = {

const _stepLine = isMaskedData() ? maskSensitiveData(stepLine) : stepLine
print(' '.repeat(this.stepShift), truncate(_stepLine, this.spaceShift))
} catch (e) {
} else if (typeof step === 'string') {
// sometimes the step is just the string, so we basically print it out
print(step)
} else {
console.log(`Something went wrong with ${step}`)
}
},

Expand Down

0 comments on commit 981ddb1

Please sign in to comment.