From d0426e0e086c915af79666dd1f99a2f117e19d48 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Wed, 22 Sep 2021 11:55:51 +0800 Subject: [PATCH] fix python bin path --- dist/setup-pdm.js | 2 +- src/setup-pdm.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/setup-pdm.js b/dist/setup-pdm.js index 3983fb9..4318ced 100644 --- a/dist/setup-pdm.js +++ b/dist/setup-pdm.js @@ -6521,13 +6521,13 @@ async function run() { try { let installedPython = await findPythonVersion(INSTALL_VERSION, arch2); await exec3.exec("python", cmdArgs); - const pythonBin = import_path.default.join(process.env.pythonLocation, IS_WINDOWS ? "Scripts/python.exe" : "bin/python"); if (core3.getInput("enable-pep582") === "true") { core3.exportVariable("PYTHONPATH", getPep582Path()); } if (core3.getInput("python-version") !== INSTALL_VERSION) { installedPython = await findPythonVersion(core3.getInput("python-version"), arch2); } + const pythonBin = import_path.default.join(process.env.pythonLocation, IS_WINDOWS ? "Scripts/python.exe" : "bin/python"); await exec3.exec("pdm", ["use", "-f", pythonBin]); const pdmVersionOutput = (await (0, import_child_process.exec)("pdm --version")).stdout; if (process.platform === "linux") { diff --git a/src/setup-pdm.ts b/src/setup-pdm.ts index 75001aa..e4b58b1 100644 --- a/src/setup-pdm.ts +++ b/src/setup-pdm.ts @@ -28,16 +28,16 @@ async function run(): Promise { try { let installedPython = await setupPython.findPythonVersion(INSTALL_VERSION, arch) await exec.exec("python", cmdArgs) - const pythonBin = path.join( - process.env.pythonLocation as string, - IS_WINDOWS ? "Scripts/python.exe" : "bin/python" - ) if (core.getInput("enable-pep582") === "true") { core.exportVariable("PYTHONPATH", getPep582Path()) } if (core.getInput("python-version") !== INSTALL_VERSION) { installedPython = await setupPython.findPythonVersion(core.getInput("python-version"), arch) } + const pythonBin = path.join( + process.env.pythonLocation as string, + IS_WINDOWS ? "Scripts/python.exe" : "bin/python" + ) await exec.exec("pdm", ["use", "-f", pythonBin]) const pdmVersionOutput = (await execChild("pdm --version")).stdout if (process.platform === "linux") {