@@ -1844,7 +1844,7 @@ var require_summary = __commonJS({
18441844 exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
18451845 var os_1 = __require("os");
18461846 var fs_1 = __require("fs");
1847- var { access, appendFile, writeFile: writeFile2 } = fs_1.promises;
1847+ var { access, appendFile: appendFile2 , writeFile: writeFile2 } = fs_1.promises;
18481848 exports.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY";
18491849 exports.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";
18501850 var Summary = class {
@@ -1880,7 +1880,7 @@ var require_summary = __commonJS({
18801880 return __awaiter(this, void 0, void 0, function* () {
18811881 const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
18821882 const filePath = yield this.filePath();
1883- const writeFunc = overwrite ? writeFile2 : appendFile ;
1883+ const writeFunc = overwrite ? writeFile2 : appendFile2 ;
18841884 yield writeFunc(filePath, this._buffer, { encoding: "utf8" });
18851885 return this.emptyBuffer();
18861886 });
@@ -9551,6 +9551,8 @@ ${stderr}`);
95519551}
95529552
95539553//
9554+ import { appendFile } from "fs/promises";
9555+ import { stripVTControlCharacters } from "util";
95549556var LogLevel;
95559557(function(LogLevel2) {
95569558 LogLevel2[LogLevel2["SILENT"] = 0] = "SILENT";
@@ -9596,7 +9598,7 @@ function runConsoleCommand(loadCommand, logLevel, ...text) {
95969598 if (getLogLevel() >= logLevel) {
95979599 loadCommand()(...text);
95989600 }
9599- printToLogFile (logLevel, ...text);
9601+ appendToLogFile (logLevel, ...text);
96009602}
96019603function getLogLevel() {
96029604 const logLevel = Object.keys(LogLevel).indexOf((process.env[`LOG_LEVEL`] || "").toUpperCase());
@@ -9605,12 +9607,22 @@ function getLogLevel() {
96059607 }
96069608 return logLevel;
96079609}
9608- var LOGGED_TEXT = "";
96099610var LOG_LEVEL_COLUMNS = 7;
9610- function printToLogFile(logLevel, ...text) {
9611+ var logFilePath = void 0;
9612+ function appendToLogFile(logLevel, ...text) {
9613+ if (logFilePath === void 0) {
9614+ return;
9615+ }
9616+ if (logLevel === void 0) {
9617+ appendFile(logFilePath, text.join(" "));
9618+ return;
9619+ }
96119620 const logLevelText = `${LogLevel[logLevel]}:`.padEnd(LOG_LEVEL_COLUMNS);
9612- LOGGED_TEXT += text.join(" ").split("\n").map((l) => `${logLevelText} ${l}
9613- `).join("");
9621+ appendFile(
9622+ logFilePath,
9623+ stripVTControlCharacters(text.join(" ").split("\n").map((l) => `${logLevelText} ${l}
9624+ `).join(""))
9625+ );
96149626}
96159627
96169628//
0 commit comments