Merge branch 'main' into report-action-aborted

This commit is contained in:
Alex Kalyvitis 2020-06-24 14:04:46 +02:00
commit a091618158
166 changed files with 16936 additions and 1318 deletions

6
lib/util.js generated
View file

@ -359,7 +359,11 @@ exports.getToolNames = getToolNames;
// Mostly intended for use within tests.
async function withTmpDir(body) {
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codeql-action-'));
const result = await body(tmpDir);
const realSubdir = path.join(tmpDir, 'real');
fs.mkdirSync(realSubdir);
const symlinkSubdir = path.join(tmpDir, 'symlink');
fs.symlinkSync(realSubdir, symlinkSubdir, 'dir');
const result = await body(symlinkSubdir);
fs.rmdirSync(tmpDir, { recursive: true });
return result;
}