diff --git a/dist/index.js b/dist/index.js index 30999ff..17ff2a1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -255,10 +255,10 @@ var require_core = __commonJS((exports2) => { return process.env["RUNNER_DEBUG"] === "1"; } exports2.isDebug = isDebug; - function debug(message) { + function debug2(message) { command_1.issueCommand("debug", {}, message); } - exports2.debug = debug; + exports2.debug = debug2; function error(message) { command_1.issue("error", message instanceof Error ? message.toString() : message); } @@ -740,15 +740,15 @@ var require_io = __commonJS((exports2) => { // node_modules/semver/semver.js var require_semver = __commonJS((exports2, module2) => { exports2 = module2.exports = SemVer; - var debug; + var debug2; if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function() { + debug2 = function() { var args = Array.prototype.slice.call(arguments, 0); args.unshift("SEMVER"); console.log.apply(console, args); }; } else { - debug = function() { + debug2 = function() { }; } exports2.SEMVER_SPEC_VERSION = "2.0.0"; @@ -845,7 +845,7 @@ var require_semver = __commonJS((exports2, module2) => { tok("STAR"); src[t.STAR] = "(<|>)?=?\\s*\\*"; for (var i = 0; i < R; i++) { - debug(i, src[i]); + debug2(i, src[i]); if (!re[i]) { re[i] = new RegExp(src[i]); } @@ -910,7 +910,7 @@ var require_semver = __commonJS((exports2, module2) => { if (!(this instanceof SemVer)) { return new SemVer(version, options); } - debug("SemVer", version, options); + debug2("SemVer", version, options); this.options = options; this.loose = !!options.loose; var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); @@ -957,7 +957,7 @@ var require_semver = __commonJS((exports2, module2) => { return this.version; }; SemVer.prototype.compare = function(other) { - debug("SemVer.compare", this.version, this.options, other); + debug2("SemVer.compare", this.version, this.options, other); if (!(other instanceof SemVer)) { other = new SemVer(other, this.options); } @@ -984,7 +984,7 @@ var require_semver = __commonJS((exports2, module2) => { do { var a = this.prerelease[i2]; var b = other.prerelease[i2]; - debug("prerelease compare", i2, a, b); + debug2("prerelease compare", i2, a, b); if (a === void 0 && b === void 0) { return 0; } else if (b === void 0) { @@ -1006,7 +1006,7 @@ var require_semver = __commonJS((exports2, module2) => { do { var a = this.build[i2]; var b = other.build[i2]; - debug("prerelease compare", i2, a, b); + debug2("prerelease compare", i2, a, b); if (a === void 0 && b === void 0) { return 0; } else if (b === void 0) { @@ -1265,7 +1265,7 @@ var require_semver = __commonJS((exports2, module2) => { if (!(this instanceof Comparator)) { return new Comparator(comp, options); } - debug("comparator", comp, options); + debug2("comparator", comp, options); this.options = options; this.loose = !!options.loose; this.parse(comp); @@ -1274,7 +1274,7 @@ var require_semver = __commonJS((exports2, module2) => { } else { this.value = this.operator + this.semver.version; } - debug("comp", this); + debug2("comp", this); } var ANY = {}; Comparator.prototype.parse = function(comp) { @@ -1297,7 +1297,7 @@ var require_semver = __commonJS((exports2, module2) => { return this.value; }; Comparator.prototype.test = function(version) { - debug("Comparator.test", version, this.options.loose); + debug2("Comparator.test", version, this.options.loose); if (this.semver === ANY || version === ANY) { return true; } @@ -1391,9 +1391,9 @@ var require_semver = __commonJS((exports2, module2) => { range = range.trim(); var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; range = range.replace(hr, hyphenReplace); - debug("hyphen replace", range); + debug2("hyphen replace", range); range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug("comparator trim", range, re[t.COMPARATORTRIM]); + debug2("comparator trim", range, re[t.COMPARATORTRIM]); range = range.replace(re[t.TILDETRIM], tildeTrimReplace); range = range.replace(re[t.CARETTRIM], caretTrimReplace); range = range.split(/\s+/).join(" "); @@ -1446,15 +1446,15 @@ var require_semver = __commonJS((exports2, module2) => { }); } function parseComparator(comp, options) { - debug("comp", comp, options); + debug2("comp", comp, options); comp = replaceCarets(comp, options); - debug("caret", comp); + debug2("caret", comp); comp = replaceTildes(comp, options); - debug("tildes", comp); + debug2("tildes", comp); comp = replaceXRanges(comp, options); - debug("xrange", comp); + debug2("xrange", comp); comp = replaceStars(comp, options); - debug("stars", comp); + debug2("stars", comp); return comp; } function isX(id) { @@ -1468,7 +1468,7 @@ var require_semver = __commonJS((exports2, module2) => { function replaceTilde(comp, options) { var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; return comp.replace(r, function(_, M, m, p, pr) { - debug("tilde", comp, _, M, m, p, pr); + debug2("tilde", comp, _, M, m, p, pr); var ret; if (isX(M)) { ret = ""; @@ -1477,12 +1477,12 @@ var require_semver = __commonJS((exports2, module2) => { } else if (isX(p)) { ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; } else if (pr) { - debug("replaceTilde pr", pr); + debug2("replaceTilde pr", pr); ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; } else { ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; } - debug("tilde return", ret); + debug2("tilde return", ret); return ret; }); } @@ -1492,10 +1492,10 @@ var require_semver = __commonJS((exports2, module2) => { }).join(" "); } function replaceCaret(comp, options) { - debug("caret", comp, options); + debug2("caret", comp, options); var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; return comp.replace(r, function(_, M, m, p, pr) { - debug("caret", comp, _, M, m, p, pr); + debug2("caret", comp, _, M, m, p, pr); var ret; if (isX(M)) { ret = ""; @@ -1508,7 +1508,7 @@ var require_semver = __commonJS((exports2, module2) => { ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0"; } } else if (pr) { - debug("replaceCaret pr", pr); + debug2("replaceCaret pr", pr); if (M === "0") { if (m === "0") { ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1); @@ -1519,7 +1519,7 @@ var require_semver = __commonJS((exports2, module2) => { ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0"; } } else { - debug("no pr"); + debug2("no pr"); if (M === "0") { if (m === "0") { ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1); @@ -1530,12 +1530,12 @@ var require_semver = __commonJS((exports2, module2) => { ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; } } - debug("caret return", ret); + debug2("caret return", ret); return ret; }); } function replaceXRanges(comp, options) { - debug("replaceXRanges", comp, options); + debug2("replaceXRanges", comp, options); return comp.split(/\s+/).map(function(comp2) { return replaceXRange(comp2, options); }).join(" "); @@ -1544,7 +1544,7 @@ var require_semver = __commonJS((exports2, module2) => { comp = comp.trim(); var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug("xRange", comp, ret, gtlt, M, m, p, pr); + debug2("xRange", comp, ret, gtlt, M, m, p, pr); var xM = isX(M); var xm = xM || isX(m); var xp = xm || isX(p); @@ -1588,12 +1588,12 @@ var require_semver = __commonJS((exports2, module2) => { } else if (xp) { ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr; } - debug("xRange return", ret); + debug2("xRange return", ret); return ret; }); } function replaceStars(comp, options) { - debug("replaceStars", comp, options); + debug2("replaceStars", comp, options); return comp.trim().replace(re[t.STAR], ""); } function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { @@ -1645,7 +1645,7 @@ var require_semver = __commonJS((exports2, module2) => { } if (version.prerelease.length && !options.includePrerelease) { for (i2 = 0; i2 < set.length; i2++) { - debug(set[i2].semver); + debug2(set[i2].semver); if (set[i2].semver === ANY) { continue; } @@ -2134,7 +2134,7 @@ var require_tunnel = __commonJS((exports2) => { connectOptions.headers = connectOptions.headers || {}; connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); } - debug("making CONNECT request"); + debug2("making CONNECT request"); var connectReq = self.request(connectOptions); connectReq.useChunkedEncodingByDefault = false; connectReq.once("response", onResponse); @@ -2154,7 +2154,7 @@ var require_tunnel = __commonJS((exports2) => { connectReq.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode !== 200) { - debug("tunneling socket could not be established, statusCode=%d", res.statusCode); + debug2("tunneling socket could not be established, statusCode=%d", res.statusCode); socket.destroy(); var error = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); error.code = "ECONNRESET"; @@ -2163,7 +2163,7 @@ var require_tunnel = __commonJS((exports2) => { return; } if (head.length > 0) { - debug("got illegal response body from proxy"); + debug2("got illegal response body from proxy"); socket.destroy(); var error = new Error("got illegal response body from proxy"); error.code = "ECONNRESET"; @@ -2171,13 +2171,13 @@ var require_tunnel = __commonJS((exports2) => { self.removeSocket(placeholder); return; } - debug("tunneling connection has established"); + debug2("tunneling connection has established"); self.sockets[self.sockets.indexOf(placeholder)] = socket; return cb(socket); } function onError(cause) { connectReq.removeAllListeners(); - debug("tunneling socket could not be established, cause=%s\n", cause.message, cause.stack); + debug2("tunneling socket could not be established, cause=%s\n", cause.message, cause.stack); var error = new Error("tunneling socket could not be established, cause=" + cause.message); error.code = "ECONNRESET"; options.request.emit("error", error); @@ -2235,9 +2235,9 @@ var require_tunnel = __commonJS((exports2) => { } return target; } - var debug; + var debug2; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug = function() { + debug2 = function() { var args = Array.prototype.slice.call(arguments); if (typeof args[0] === "string") { args[0] = "TUNNEL: " + args[0]; @@ -2247,10 +2247,10 @@ var require_tunnel = __commonJS((exports2) => { console.error.apply(console, args); }; } else { - debug = function() { + debug2 = function() { }; } - exports2.debug = debug; + exports2.debug = debug2; }); // node_modules/tunnel/index.js diff --git a/index.ts b/index.ts index 94cba82..45a76ec 100644 --- a/index.ts +++ b/index.ts @@ -1,9 +1,10 @@ -import { addPath, getInput, setFailed } from "@actions/core"; +import { addPath, getInput, setFailed, debug } from "@actions/core"; import os from "os"; import cache from "@actions/tool-cache"; import { promisify } from "util"; import fs from "fs"; import path from "path"; +import { countReset } from "console"; const chmod = promisify(fs.chmod); @@ -19,7 +20,7 @@ async function main() { arch = "amd64"; } - let toolPath = cache.find("pack", version, arch); + let toolPath = cache.find(FILENAME, version, arch); if (!toolPath) { const context: { [key: string]: string } = { arch, @@ -39,6 +40,8 @@ async function main() { ); } + debug("toolpath:" + toolPath); + await chmod(path.join(toolPath, FILENAME), 0o755); addPath(toolPath); } catch (err) {