Skip to content

Commit 36d4acc

Browse files
authored
feat: longer log padding and small refactor (#7)
1 parent 7756260 commit 36d4acc

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/messages.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ export const saySetupIsRunning = (preferences: Preferences) => {
4848
}
4949

5050
const sayCommand = (command: string, comment = "") => {
51+
const coloredCommand = chalk.blue(`> ${command}`)
5152
if (comment.length > 0) {
52-
console.log(chalk.blue(`> ${command}`).padEnd(32, " "), chalk.gray(`// ${comment}`))
53+
const coloredComment = chalk.gray(`// ${comment}`)
54+
55+
// pad command to have unified length for all logging output
56+
const assembledLine = `${coloredCommand.padEnd(40, " ")} ${coloredComment}`
57+
console.log(assembledLine)
5358
} else {
54-
console.log(chalk.blue(`> ${command}`))
59+
console.log(coloredCommand)
5560
}
5661
}
5762

0 commit comments

Comments
 (0)