Skip to content

Commit

Permalink
⬆️ Cleanup extension
Browse files Browse the repository at this point in the history
  • Loading branch information
hybloid committed Dec 20, 2024
1 parent 672185c commit d2a2468
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions vsts/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,8 @@ export async function qodana(args: string[] = []): Promise<number> {
if (args.length === 0) {
const inputs = getInputs()
args = getQodanaScanArgs(inputs.args, inputs.resultsDir, inputs.cacheDir)
console.log('PR Mode' + inputs.prMode)
console.log('Build Reason' + tl.getVariable('Build.Reason'))
console.log(
'Source Branch' +
(process.env.QODANA_BRANCH || getSourceAndTargetBranches().sourceBranch)
)
if (inputs.prMode && tl.getVariable('Build.Reason') === 'PullRequest') {
const sha = await getPrSha()
console.log('PR SHA' + sha)
if (sha !== '') {
args.push('--commit', sha)
const sourceBranch =
Expand Down Expand Up @@ -233,8 +226,7 @@ async function git(
args: string[],
options: IExecOptions = {}
): Promise<number> {
const execResult = await gitOutput(args, options)
return execResult.exitCode
return (await gitOutput(args, options)).exitCode
}

async function gitOutput(
Expand All @@ -248,17 +240,17 @@ async function gitOutput(
}

const outStream = new Writable({
write(chunk, encoding, callback) {
write(chunk, _, callback) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
result.stdout += chunk.toString(encoding || 'utf8')
result.stdout += chunk.toString('utf8')
callback()
}
})

const errStream = new Writable({
write(chunk, encoding, callback) {
write(chunk, _, callback) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
result.stderr += chunk.toString(encoding || 'utf8')
result.stderr += chunk.toString('utf8')
callback()
}
})
Expand Down

0 comments on commit d2a2468

Please sign in to comment.