From b756184efae58ec6dd0a7ac7a18dc4a7638ed56a Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Tue, 6 Apr 2021 09:13:28 +0800 Subject: [PATCH] fix version output --- dist/setup-pdm.js | 4 ++-- src/setup-pdm.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/setup-pdm.js b/dist/setup-pdm.js index f3f44a7..f2f34e3 100644 --- a/dist/setup-pdm.js +++ b/dist/setup-pdm.js @@ -6183,11 +6183,11 @@ async function run() { installedPython = await findPythonVersion(core3.getInput("python-version"), arch2); } await exec3.exec("pdm", ["use", "-f", installedPython.version]); - const pdmVersionOutput = (await (0, import_child_process.exec)("pdm --version")).stdout?.read(); + const pdmVersionOutput = (await (0, import_child_process.exec)("pdm --version")).stdout; if (process.platform === "linux") { core3.exportVariable("LD_PRELOAD", "/lib/x86_64-linux-gnu/libgcc_s.so.1"); } - core3.info(`Successfully setup ${pdmVersionOutput} with Python ${installedPython.version}`); + core3.info(`Successfully setup ${pdmVersionOutput && pdmVersionOutput.read()} with Python ${installedPython.version}`); const matchersPath = import_path.default.join(__dirname, "..", ".github"); core3.info(`##[add-matcher]${import_path.default.join(matchersPath, "python.json")}`); } catch (error2) { diff --git a/src/setup-pdm.ts b/src/setup-pdm.ts index 2e1ec02..335e0cb 100644 --- a/src/setup-pdm.ts +++ b/src/setup-pdm.ts @@ -25,13 +25,13 @@ async function run(): Promise { ); } await exec.exec("pdm", ["use", "-f", installedPython.version]); - const pdmVersionOutput = (await execChild("pdm --version")).stdout?.read(); + const pdmVersionOutput = (await execChild("pdm --version")).stdout; if (process.platform === 'linux') { // See https://github.com/actions/virtual-environments/issues/2803 core.exportVariable('LD_PRELOAD', '/lib/x86_64-linux-gnu/libgcc_s.so.1'); } core.info( - `Successfully setup ${pdmVersionOutput} with Python ${installedPython.version}` + `Successfully setup ${pdmVersionOutput && pdmVersionOutput.read()} with Python ${installedPython.version}` ); const matchersPath = path.join(__dirname, '..', '.github'); core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`);