Skip to content

Commit

Permalink
fix: fix the pipx packages bin directory
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Sep 19, 2024
1 parent 4d73853 commit c9bc540
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs.map

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions src/utils/setup/setupPipPack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ export async function setupPipPackWithPython(
? await pipxPackageInstalled(givenPython, nameOnly)
: await pipPackageIsInstalled(givenPython, nameOnly)
if (installed) {
const binDir = await finishPipPackageInstall(givenPython, nameOnly)
const binDir = isPipx
? await finishPipxPackageInstall()
: await finishPipPackageInstall(givenPython, nameOnly)
return { binDir }
}
}
Expand Down Expand Up @@ -99,10 +101,16 @@ export async function setupPipPackWithPython(
throw new Error(`Failed to install ${name} as it was not found via ${pip} or the system package manager`)
}

const binDir = await finishPipPackageInstall(givenPython, nameOnly)
const binDir = isPipx
? await finishPipxPackageInstall()
: await finishPipPackageInstall(givenPython, nameOnly)
return { binDir }
}

function finishPipxPackageInstall() {
return getPipxBinDir()
}

async function finishPipPackageInstall(givenPython: string, name: string) {
const pythonBaseExecPrefix = await addPythonBaseExecPrefix(givenPython)
const binDir = await findBinDir(pythonBaseExecPrefix, name)
Expand Down

0 comments on commit c9bc540

Please sign in to comment.