Merge branch 'main' into chrisgavin/default-bundle-version-json

This commit is contained in:
Chris Gavin 2020-08-11 17:52:34 +01:00
commit 9c5f7640e5
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
27 changed files with 107 additions and 184 deletions

View file

@ -2,7 +2,6 @@ import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as http from '@actions/http-client';
import { IHeaders } from '@actions/http-client/interfaces';
import * as io from '@actions/io';
import * as toolcache from '@actions/tool-cache';
import * as fs from 'fs';
import * as path from 'path';
@ -155,7 +154,7 @@ async function toolcacheDownloadTool(url: string, headers?: IHeaders): Promise<s
throw err;
}
const pipeline = globalutil.promisify(stream.pipeline);
await io.mkdirP(path.dirname(dest));
fs.mkdirSync(path.dirname(dest), { recursive: true });
await pipeline(response.message, fs.createWriteStream(dest));
return dest;
}
@ -391,3 +390,11 @@ function getCodeQLForCmd(cmd: string): CodeQL {
}
};
}
export function isTracedLanguage(language: string): boolean {
return ['cpp', 'java', 'csharp'].includes(language);
}
export function isScannedLanguage(language: string): boolean {
return !isTracedLanguage(language);
}