@@ -2970,11 +2970,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
29702970};
29712971var _a;
29722972Object.defineProperty(exports, "__esModule", ({ value: true }));
2973- exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
2973+ exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports. IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports. rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
29742974const fs = __importStar(__nccwpck_require__(9896));
29752975const path = __importStar(__nccwpck_require__(6928));
2976- _a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
2976+ _a = fs.promises
2977+ // export const {open} = 'fs'
2978+ , exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
2979+ // export const {open} = 'fs'
29772980exports.IS_WINDOWS = process.platform === 'win32';
2981+ // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
2982+ exports.UV_FS_O_EXLOCK = 0x10000000;
2983+ exports.READONLY = fs.constants.O_RDONLY;
29782984function exists(fsPath) {
29792985 return __awaiter(this, void 0, void 0, function* () {
29802986 try {
@@ -3154,12 +3160,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31543160Object.defineProperty(exports, "__esModule", ({ value: true }));
31553161exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
31563162const assert_1 = __nccwpck_require__(2613);
3157- const childProcess = __importStar(__nccwpck_require__(5317));
31583163const path = __importStar(__nccwpck_require__(6928));
3159- const util_1 = __nccwpck_require__(9023);
31603164const ioUtil = __importStar(__nccwpck_require__(5207));
3161- const exec = util_1.promisify(childProcess.exec);
3162- const execFile = util_1.promisify(childProcess.execFile);
31633165/**
31643166 * Copies a file or folder.
31653167 * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
@@ -3240,61 +3242,23 @@ exports.mv = mv;
32403242function rmRF(inputPath) {
32413243 return __awaiter(this, void 0, void 0, function* () {
32423244 if (ioUtil.IS_WINDOWS) {
3243- // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
3244- // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
32453245 // Check for invalid characters
32463246 // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
32473247 if (/[*"<>|]/.test(inputPath)) {
32483248 throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
32493249 }
3250- try {
3251- const cmdPath = ioUtil.getCmdPath();
3252- if (yield ioUtil.isDirectory(inputPath, true)) {
3253- yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
3254- env: { inputPath }
3255- });
3256- }
3257- else {
3258- yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
3259- env: { inputPath }
3260- });
3261- }
3262- }
3263- catch (err) {
3264- // if you try to delete a file that doesn't exist, desired result is achieved
3265- // other errors are valid
3266- if (err.code !== 'ENOENT')
3267- throw err;
3268- }
3269- // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
3270- try {
3271- yield ioUtil.unlink(inputPath);
3272- }
3273- catch (err) {
3274- // if you try to delete a file that doesn't exist, desired result is achieved
3275- // other errors are valid
3276- if (err.code !== 'ENOENT')
3277- throw err;
3278- }
32793250 }
3280- else {
3281- let isDir = false;
3282- try {
3283- isDir = yield ioUtil.isDirectory(inputPath);
3284- }
3285- catch (err) {
3286- // if you try to delete a file that doesn't exist, desired result is achieved
3287- // other errors are valid
3288- if (err.code !== 'ENOENT')
3289- throw err;
3290- return;
3291- }
3292- if (isDir) {
3293- yield execFile(`rm`, [`-rf`, `${inputPath}`]);
3294- }
3295- else {
3296- yield ioUtil.unlink(inputPath);
3297- }
3251+ try {
3252+ // note if path does not exist, error is silent
3253+ yield ioUtil.rm(inputPath, {
3254+ force: true,
3255+ maxRetries: 3,
3256+ recursive: true,
3257+ retryDelay: 300
3258+ });
3259+ }
3260+ catch (err) {
3261+ throw new Error(`File was unable to be removed ${err}`);
32983262 }
32993263 });
33003264}
@@ -3573,25 +3537,40 @@ var __copyProps = (to, from, except, desc) => {
35733537var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35743538
35753539// pkg/dist-src/index.js
3576- var dist_src_exports = {};
3577- __export(dist_src_exports , {
3540+ var index_exports = {};
3541+ __export(index_exports , {
35783542 Octokit: () => Octokit
35793543});
3580- module.exports = __toCommonJS(dist_src_exports );
3544+ module.exports = __toCommonJS(index_exports );
35813545var import_universal_user_agent = __nccwpck_require__(3843);
35823546var import_before_after_hook = __nccwpck_require__(2732);
35833547var import_request = __nccwpck_require__(8636);
35843548var import_graphql = __nccwpck_require__(7);
35853549var import_auth_token = __nccwpck_require__(7864);
35863550
35873551// pkg/dist-src/version.js
3588- var VERSION = "5.2.0 ";
3552+ var VERSION = "5.2.2 ";
35893553
35903554// pkg/dist-src/index.js
35913555var noop = () => {
35923556};
35933557var consoleWarn = console.warn.bind(console);
35943558var consoleError = console.error.bind(console);
3559+ function createLogger(logger = {}) {
3560+ if (typeof logger.debug !== "function") {
3561+ logger.debug = noop;
3562+ }
3563+ if (typeof logger.info !== "function") {
3564+ logger.info = noop;
3565+ }
3566+ if (typeof logger.warn !== "function") {
3567+ logger.warn = consoleWarn;
3568+ }
3569+ if (typeof logger.error !== "function") {
3570+ logger.error = consoleError;
3571+ }
3572+ return logger;
3573+ }
35953574var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
35963575var Octokit = class {
35973576 static {
@@ -3665,15 +3644,7 @@ var Octokit = class {
36653644 }
36663645 this.request = import_request.request.defaults(requestDefaults);
36673646 this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
3668- this.log = Object.assign(
3669- {
3670- debug: noop,
3671- info: noop,
3672- warn: consoleWarn,
3673- error: consoleError
3674- },
3675- options.log
3676- );
3647+ this.log = createLogger(options.log);
36773648 this.hook = hook;
36783649 if (!options.authStrategy) {
36793650 if (!options.auth) {
0 commit comments