Skip to content

Commit

Permalink
chore: clean up debugging
Browse files Browse the repository at this point in the history
Signed-off-by: Ourchitecture <[email protected]>
  • Loading branch information
ourchitectureio committed Sep 20, 2023
1 parent 41b139f commit 78337f6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/tasks/node/check/formatting.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const log = require('../../../libraries/node/log')
const executePnpmCommand = async (
scriptFilePath,
commandLogFileName,
isLogStdErrAsErrorEnabled,
commandArgv
) => {
const commandName = 'pnpm'
Expand All @@ -19,7 +20,11 @@ const executePnpmCommand = async (
log.info(stdout)
},
(stderr) => {
log.error(stderr)
if (isLogStdErrAsErrorEnabled) {
log.error(stderr)
} else {
log.info(stderr)
}
}
)

Expand Down Expand Up @@ -64,7 +69,12 @@ const checkFormattingWithPrettier = async (scriptFilePath) => {
host.getRelativeToRootPath('./'),
]

return await executePnpmCommand(scriptFilePath, 'prettier.log', commandArgv)
return await executePnpmCommand(
scriptFilePath,
'prettier.log',
false, // prettier doesn't appear to use 'stderr'
commandArgv
)
}

const checkFormattingWithMarkdownlint = async (scriptFilePath) => {
Expand All @@ -77,6 +87,7 @@ const checkFormattingWithMarkdownlint = async (scriptFilePath) => {
return await executePnpmCommand(
scriptFilePath,
'markdownlint.log',
true, // BUG: markdownlint seems to use 'stderr' for output
commandArgv
)
}
Expand Down

0 comments on commit 78337f6

Please sign in to comment.