fix windows pythonpath

This commit is contained in:
Frost Ming 2021-09-22 13:38:35 +08:00
parent 72b77e8bf4
commit 3b04047282
No known key found for this signature in database
GPG Key ID: 5BFA9CB4DDA943BF
3 changed files with 4 additions and 3 deletions

View File

@ -4,10 +4,11 @@ name: Test Action
jobs:
Testing:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10.0-beta - 3.10.0"]
os: ["ubuntu-latest", "windows-latest"]
name: Test the action
steps:
- uses: actions/checkout@v2

2
dist/setup-pdm.js vendored
View File

@ -6527,7 +6527,7 @@ async function run() {
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");
const pythonBin = import_path.default.join(process.env.pythonLocation, IS_WINDOWS ? "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") {

View File

@ -36,7 +36,7 @@ async function run(): Promise<void> {
}
const pythonBin = path.join(
process.env.pythonLocation as string,
IS_WINDOWS ? "Scripts/python.exe" : "bin/python"
IS_WINDOWS ? "python.exe" : "bin/python"
)
await exec.exec("pdm", ["use", "-f", pythonBin])
const pdmVersionOutput = (await execChild("pdm --version")).stdout