Bump artifact dependencies if CODEQL_ACTION_ARTIFACT_V2_UPGRADE enabled (#2482)
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com> Co-authored-by: Henry Mercer <henrymercer@github.com>
This commit is contained in:
parent
cf5b0a9041
commit
a196a714b8
5388 changed files with 2176737 additions and 71701 deletions
50
node_modules/tmp/lib/tmp.js
generated
vendored
50
node_modules/tmp/lib/tmp.js
generated
vendored
|
|
@ -14,7 +14,6 @@ const os = require('os');
|
|||
const path = require('path');
|
||||
const crypto = require('crypto');
|
||||
const _c = { fs: fs.constants, os: os.constants };
|
||||
const rimraf = require('rimraf');
|
||||
|
||||
/*
|
||||
* The working inner variables.
|
||||
|
|
@ -43,12 +42,32 @@ const
|
|||
_removeObjects = [],
|
||||
|
||||
// API change in fs.rmdirSync leads to error when passing in a second parameter, e.g. the callback
|
||||
FN_RMDIR_SYNC = fs.rmdirSync.bind(fs),
|
||||
FN_RIMRAF_SYNC = rimraf.sync;
|
||||
FN_RMDIR_SYNC = fs.rmdirSync.bind(fs);
|
||||
|
||||
let
|
||||
_gracefulCleanup = false;
|
||||
|
||||
/**
|
||||
* Recursively remove a directory and its contents.
|
||||
*
|
||||
* @param {string} dirPath path of directory to remove
|
||||
* @param {Function} callback
|
||||
* @private
|
||||
*/
|
||||
function rimraf(dirPath, callback) {
|
||||
return fs.rm(dirPath, { recursive: true }, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively remove a directory and its contents, synchronously.
|
||||
*
|
||||
* @param {string} dirPath path of directory to remove
|
||||
* @private
|
||||
*/
|
||||
function FN_RIMRAF_SYNC(dirPath) {
|
||||
return fs.rmSync(dirPath, { recursive: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a temporary file name.
|
||||
*
|
||||
|
|
@ -535,7 +554,7 @@ function _assertAndSanitizeOptions(options) {
|
|||
options.template = _isBlank(options.template) ? undefined : path.relative(options.dir, options.template);
|
||||
|
||||
// for completeness' sake only, also keep (multiple) blanks if the user, purportedly sane, requests us to
|
||||
options.name = _isUndefined(options.name) ? undefined : _sanitizeName(options.name);
|
||||
options.name = _isUndefined(options.name) ? undefined : options.name;
|
||||
options.prefix = _isUndefined(options.prefix) ? '' : options.prefix;
|
||||
options.postfix = _isUndefined(options.postfix) ? '' : options.postfix;
|
||||
}
|
||||
|
|
@ -552,28 +571,13 @@ function _assertAndSanitizeOptions(options) {
|
|||
* @private
|
||||
*/
|
||||
function _resolvePath(name, tmpDir) {
|
||||
const sanitizedName = _sanitizeName(name);
|
||||
if (sanitizedName.startsWith(tmpDir)) {
|
||||
return path.resolve(sanitizedName);
|
||||
if (name.startsWith(tmpDir)) {
|
||||
return path.resolve(name);
|
||||
} else {
|
||||
return path.resolve(path.join(tmpDir, sanitizedName));
|
||||
return path.resolve(path.join(tmpDir, name));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize the specified path name by removing all quote characters.
|
||||
*
|
||||
* @param name
|
||||
* @returns {string}
|
||||
* @private
|
||||
*/
|
||||
function _sanitizeName(name) {
|
||||
if (_isBlank(name)) {
|
||||
return name;
|
||||
}
|
||||
return name.replace(/["']/g, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts whether specified name is relative to the specified tmpDir.
|
||||
*
|
||||
|
|
@ -663,7 +667,7 @@ function setGracefulCleanup() {
|
|||
* @returns {string} the currently configured tmp dir
|
||||
*/
|
||||
function _getTmpDir(options) {
|
||||
return path.resolve(_sanitizeName(options && options.tmpdir || os.tmpdir()));
|
||||
return path.resolve(options && options.tmpdir || os.tmpdir());
|
||||
}
|
||||
|
||||
// Install process exit listener
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue