From 38e1018663fa5173f3968ea0777460d3de38f256 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Sun, 5 May 2024 01:13:21 +0200 Subject: [PATCH] feat: improve log about pwd/cwd (#1033) --- dist/post_run/index.js | 4 ++-- dist/run/index.js | 4 ++-- src/run.ts | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dist/post_run/index.js b/dist/post_run/index.js index 23f6c001c0..87f67815a6 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -89329,8 +89329,8 @@ async function runLint(lintPath, patchPath) { break; } } - const workingDirectory = core.getInput(`working-directory`); const cmdArgs = {}; + const workingDirectory = core.getInput(`working-directory`); if (workingDirectory) { if (!fs.existsSync(workingDirectory) || !fs.lstatSync(workingDirectory).isDirectory()) { throw new Error(`working-directory (${workingDirectory}) was not a path`); @@ -89341,7 +89341,7 @@ async function runLint(lintPath, patchPath) { cmdArgs.cwd = path.resolve(workingDirectory); } const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd(); - core.info(`Running [${cmd}] in [${cmdArgs.cwd || ``}] ...`); + core.info(`Running [${cmd}] in [${cmdArgs.cwd || process.cwd()}] ...`); const startedAt = Date.now(); try { const res = await execShellCommand(cmd, cmdArgs); diff --git a/dist/run/index.js b/dist/run/index.js index 428acc2f77..11ef531598 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -89329,8 +89329,8 @@ async function runLint(lintPath, patchPath) { break; } } - const workingDirectory = core.getInput(`working-directory`); const cmdArgs = {}; + const workingDirectory = core.getInput(`working-directory`); if (workingDirectory) { if (!fs.existsSync(workingDirectory) || !fs.lstatSync(workingDirectory).isDirectory()) { throw new Error(`working-directory (${workingDirectory}) was not a path`); @@ -89341,7 +89341,7 @@ async function runLint(lintPath, patchPath) { cmdArgs.cwd = path.resolve(workingDirectory); } const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd(); - core.info(`Running [${cmd}] in [${cmdArgs.cwd || ``}] ...`); + core.info(`Running [${cmd}] in [${cmdArgs.cwd || process.cwd()}] ...`); const startedAt = Date.now(); try { const res = await execShellCommand(cmd, cmdArgs); diff --git a/src/run.ts b/src/run.ts index 48550d4576..9cffa9c690 100644 --- a/src/run.ts +++ b/src/run.ts @@ -233,8 +233,9 @@ async function runLint(lintPath: string, patchPath: string): Promise { } } - const workingDirectory = core.getInput(`working-directory`) const cmdArgs: ExecOptions = {} + + const workingDirectory = core.getInput(`working-directory`) if (workingDirectory) { if (!fs.existsSync(workingDirectory) || !fs.lstatSync(workingDirectory).isDirectory()) { throw new Error(`working-directory (${workingDirectory}) was not a path`) @@ -247,7 +248,7 @@ async function runLint(lintPath: string, patchPath: string): Promise { const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd() - core.info(`Running [${cmd}] in [${cmdArgs.cwd || ``}] ...`) + core.info(`Running [${cmd}] in [${cmdArgs.cwd || process.cwd()}] ...`) const startedAt = Date.now() try {