mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Consistently use "\n" to split lines, then trim extra characters if needed
This commit is contained in:
57
lib/start-proxy-action.js
generated
57
lib/start-proxy-action.js
generated
@@ -108,11 +108,11 @@ var require_command = __commonJS({
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.issueCommand = issueCommand;
|
||||
exports2.issue = issue;
|
||||
var os3 = __importStar2(require("os"));
|
||||
var os2 = __importStar2(require("os"));
|
||||
var utils_1 = require_utils();
|
||||
function issueCommand(command, properties, message) {
|
||||
const cmd = new Command(command, properties, message);
|
||||
process.stdout.write(cmd.toString() + os3.EOL);
|
||||
process.stdout.write(cmd.toString() + os2.EOL);
|
||||
}
|
||||
function issue(name, message = "") {
|
||||
issueCommand(name, {}, message);
|
||||
@@ -205,7 +205,7 @@ var require_file_command = __commonJS({
|
||||
exports2.prepareKeyValueMessage = prepareKeyValueMessage;
|
||||
var crypto2 = __importStar2(require("crypto"));
|
||||
var fs3 = __importStar2(require("fs"));
|
||||
var os3 = __importStar2(require("os"));
|
||||
var os2 = __importStar2(require("os"));
|
||||
var utils_1 = require_utils();
|
||||
function issueFileCommand(command, message) {
|
||||
const filePath = process.env[`GITHUB_${command}`];
|
||||
@@ -215,7 +215,7 @@ var require_file_command = __commonJS({
|
||||
if (!fs3.existsSync(filePath)) {
|
||||
throw new Error(`Missing file at path: ${filePath}`);
|
||||
}
|
||||
fs3.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, {
|
||||
fs3.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, {
|
||||
encoding: "utf8"
|
||||
});
|
||||
}
|
||||
@@ -228,7 +228,7 @@ var require_file_command = __commonJS({
|
||||
if (convertedValue.includes(delimiter)) {
|
||||
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
|
||||
}
|
||||
return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`;
|
||||
return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -20575,7 +20575,7 @@ var require_toolrunner = __commonJS({
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.ToolRunner = void 0;
|
||||
exports2.argStringToArray = argStringToArray;
|
||||
var os3 = __importStar2(require("os"));
|
||||
var os2 = __importStar2(require("os"));
|
||||
var events = __importStar2(require("events"));
|
||||
var child = __importStar2(require("child_process"));
|
||||
var path5 = __importStar2(require("path"));
|
||||
@@ -20630,12 +20630,12 @@ var require_toolrunner = __commonJS({
|
||||
_processLineBuffer(data, strBuffer, onLine) {
|
||||
try {
|
||||
let s = strBuffer + data.toString();
|
||||
let n = s.indexOf(os3.EOL);
|
||||
let n = s.indexOf(os2.EOL);
|
||||
while (n > -1) {
|
||||
const line = s.substring(0, n);
|
||||
onLine(line);
|
||||
s = s.substring(n + os3.EOL.length);
|
||||
n = s.indexOf(os3.EOL);
|
||||
s = s.substring(n + os2.EOL.length);
|
||||
n = s.indexOf(os2.EOL);
|
||||
}
|
||||
return s;
|
||||
} catch (err) {
|
||||
@@ -20804,7 +20804,7 @@ var require_toolrunner = __commonJS({
|
||||
}
|
||||
const optionsNonNull = this._cloneExecOptions(this.options);
|
||||
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
||||
optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os3.EOL);
|
||||
optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os2.EOL);
|
||||
}
|
||||
const state = new ExecState(optionsNonNull, this.toolPath);
|
||||
state.on("debug", (message) => {
|
||||
@@ -21345,7 +21345,7 @@ var require_core = __commonJS({
|
||||
var command_1 = require_command();
|
||||
var file_command_1 = require_file_command();
|
||||
var utils_1 = require_utils();
|
||||
var os3 = __importStar2(require("os"));
|
||||
var os2 = __importStar2(require("os"));
|
||||
var path5 = __importStar2(require("path"));
|
||||
var oidc_utils_1 = require_oidc_utils();
|
||||
var ExitCode;
|
||||
@@ -21407,7 +21407,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
||||
if (filePath) {
|
||||
return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value));
|
||||
}
|
||||
process.stdout.write(os3.EOL);
|
||||
process.stdout.write(os2.EOL);
|
||||
(0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value));
|
||||
}
|
||||
function setCommandEcho(enabled) {
|
||||
@@ -21433,7 +21433,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
||||
(0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
||||
}
|
||||
function info6(message) {
|
||||
process.stdout.write(message + os3.EOL);
|
||||
process.stdout.write(message + os2.EOL);
|
||||
}
|
||||
function startGroup3(name) {
|
||||
(0, command_1.issue)("group", name);
|
||||
@@ -48691,7 +48691,7 @@ var require_internal_pattern = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.Pattern = void 0;
|
||||
var os3 = __importStar2(require("os"));
|
||||
var os2 = __importStar2(require("os"));
|
||||
var path5 = __importStar2(require("path"));
|
||||
var pathHelper = __importStar2(require_internal_path_helper());
|
||||
var assert_1 = __importDefault2(require("assert"));
|
||||
@@ -48784,7 +48784,7 @@ var require_internal_pattern = __commonJS({
|
||||
if (pattern === "." || pattern.startsWith(`.${path5.sep}`)) {
|
||||
pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1);
|
||||
} else if (pattern === "~" || pattern.startsWith(`~${path5.sep}`)) {
|
||||
homedir = homedir || os3.homedir();
|
||||
homedir = homedir || os2.homedir();
|
||||
(0, assert_1.default)(homedir, "Unable to determine HOME directory");
|
||||
(0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);
|
||||
pattern = _Pattern.globEscape(homedir) + pattern.substr(1);
|
||||
@@ -53686,7 +53686,7 @@ var require_has_flag = __commonJS({
|
||||
var require_supports_color = __commonJS({
|
||||
"node_modules/supports-color/index.js"(exports2, module2) {
|
||||
"use strict";
|
||||
var os3 = require("os");
|
||||
var os2 = require("os");
|
||||
var tty = require("tty");
|
||||
var hasFlag = require_has_flag();
|
||||
var { env } = process;
|
||||
@@ -53734,7 +53734,7 @@ var require_supports_color = __commonJS({
|
||||
return min;
|
||||
}
|
||||
if (process.platform === "win32") {
|
||||
const osRelease = os3.release().split(".");
|
||||
const osRelease = os2.release().split(".");
|
||||
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
||||
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
||||
}
|
||||
@@ -97597,12 +97597,12 @@ var require_manifest = __commonJS({
|
||||
exports2._readLinuxVersionFile = _readLinuxVersionFile;
|
||||
var semver6 = __importStar2(require_semver2());
|
||||
var core_1 = require_core();
|
||||
var os3 = require("os");
|
||||
var os2 = require("os");
|
||||
var cp = require("child_process");
|
||||
var fs3 = require("fs");
|
||||
function _findMatch(versionSpec, stable, candidates, archFilter) {
|
||||
return __awaiter2(this, void 0, void 0, function* () {
|
||||
const platFilter = os3.platform();
|
||||
const platFilter = os2.platform();
|
||||
let result;
|
||||
let match;
|
||||
let file;
|
||||
@@ -97638,7 +97638,7 @@ var require_manifest = __commonJS({
|
||||
});
|
||||
}
|
||||
function _getOsVersion() {
|
||||
const plat = os3.platform();
|
||||
const plat = os2.platform();
|
||||
let version = "";
|
||||
if (plat === "darwin") {
|
||||
version = cp.execSync("sw_vers -productVersion").toString();
|
||||
@@ -97875,7 +97875,7 @@ var require_tool_cache = __commonJS({
|
||||
var crypto2 = __importStar2(require("crypto"));
|
||||
var fs3 = __importStar2(require("fs"));
|
||||
var mm = __importStar2(require_manifest());
|
||||
var os3 = __importStar2(require("os"));
|
||||
var os2 = __importStar2(require("os"));
|
||||
var path5 = __importStar2(require("path"));
|
||||
var httpm = __importStar2(require_lib());
|
||||
var semver6 = __importStar2(require_semver2());
|
||||
@@ -98152,7 +98152,7 @@ var require_tool_cache = __commonJS({
|
||||
function cacheDir2(sourceDir, tool, version, arch) {
|
||||
return __awaiter2(this, void 0, void 0, function* () {
|
||||
version = semver6.clean(version) || version;
|
||||
arch = arch || os3.arch();
|
||||
arch = arch || os2.arch();
|
||||
core12.debug(`Caching tool ${tool} ${version} ${arch}`);
|
||||
core12.debug(`source dir: ${sourceDir}`);
|
||||
if (!fs3.statSync(sourceDir).isDirectory()) {
|
||||
@@ -98170,7 +98170,7 @@ var require_tool_cache = __commonJS({
|
||||
function cacheFile(sourceFile, targetFile, tool, version, arch) {
|
||||
return __awaiter2(this, void 0, void 0, function* () {
|
||||
version = semver6.clean(version) || version;
|
||||
arch = arch || os3.arch();
|
||||
arch = arch || os2.arch();
|
||||
core12.debug(`Caching tool ${tool} ${version} ${arch}`);
|
||||
core12.debug(`source file: ${sourceFile}`);
|
||||
if (!fs3.statSync(sourceFile).isFile()) {
|
||||
@@ -98191,7 +98191,7 @@ var require_tool_cache = __commonJS({
|
||||
if (!versionSpec) {
|
||||
throw new Error("versionSpec parameter is required");
|
||||
}
|
||||
arch = arch || os3.arch();
|
||||
arch = arch || os2.arch();
|
||||
if (!isExplicitVersion(versionSpec)) {
|
||||
const localVersions = findAllVersions(toolName, arch);
|
||||
const match = evaluateVersions(localVersions, versionSpec);
|
||||
@@ -98213,7 +98213,7 @@ var require_tool_cache = __commonJS({
|
||||
}
|
||||
function findAllVersions(toolName, arch) {
|
||||
const versions = [];
|
||||
arch = arch || os3.arch();
|
||||
arch = arch || os2.arch();
|
||||
const toolPath = path5.join(_getCacheDirectory(), toolName);
|
||||
if (fs3.existsSync(toolPath)) {
|
||||
const children = fs3.readdirSync(toolPath);
|
||||
@@ -98263,7 +98263,7 @@ var require_tool_cache = __commonJS({
|
||||
});
|
||||
}
|
||||
function findFromManifest(versionSpec_1, stable_1, manifest_1) {
|
||||
return __awaiter2(this, arguments, void 0, function* (versionSpec, stable, manifest, archFilter = os3.arch()) {
|
||||
return __awaiter2(this, arguments, void 0, function* (versionSpec, stable, manifest, archFilter = os2.arch()) {
|
||||
const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
|
||||
return match;
|
||||
});
|
||||
@@ -121814,7 +121814,6 @@ function generateCertificateAuthority(newCertGenFF) {
|
||||
|
||||
// src/start-proxy/environment.ts
|
||||
var fs2 = __toESM(require("fs"));
|
||||
var os2 = __toESM(require("os"));
|
||||
var path3 = __toESM(require("path"));
|
||||
function checkEnvVar(logger, name) {
|
||||
const value = process.env[name];
|
||||
@@ -121876,11 +121875,11 @@ function checkJdkSettings(logger, jdkHome) {
|
||||
try {
|
||||
if (fs2.existsSync(file)) {
|
||||
logger.debug(`Found '${file}'.`);
|
||||
const lines = String(fs2.readFileSync(file)).split(os2.EOL);
|
||||
const lines = String(fs2.readFileSync(file)).split("\n");
|
||||
for (const line of lines) {
|
||||
for (const property of properties) {
|
||||
if (line.startsWith(`${property}=`)) {
|
||||
logger.info(`Found '${line}' in '${file}'.`);
|
||||
logger.info(`Found '${line.trimEnd()}' in '${file}'.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as fs from "fs";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
|
||||
import { JavaEnvVars, KnownLanguage, Language } from "../languages";
|
||||
@@ -101,11 +100,11 @@ export function checkJdkSettings(logger: Logger, jdkHome: string) {
|
||||
if (fs.existsSync(file)) {
|
||||
logger.debug(`Found '${file}'.`);
|
||||
|
||||
const lines = String(fs.readFileSync(file)).split(os.EOL);
|
||||
const lines = String(fs.readFileSync(file)).split("\n");
|
||||
for (const line of lines) {
|
||||
for (const property of properties) {
|
||||
if (line.startsWith(`${property}=`)) {
|
||||
logger.info(`Found '${line}' in '${file}'.`);
|
||||
logger.info(`Found '${line.trimEnd()}' in '${file}'.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user