Skip to content

Commit c9bc540

Browse files
committed
fix: fix the pipx packages bin directory
1 parent 4d73853 commit c9bc540

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

dist/legacy/setup-cpp.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

+1-1
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

+1-1
Large diffs are not rendered by default.

src/utils/setup/setupPipPack.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ export async function setupPipPackWithPython(
6262
? await pipxPackageInstalled(givenPython, nameOnly)
6363
: await pipPackageIsInstalled(givenPython, nameOnly)
6464
if (installed) {
65-
const binDir = await finishPipPackageInstall(givenPython, nameOnly)
65+
const binDir = isPipx
66+
? await finishPipxPackageInstall()
67+
: await finishPipPackageInstall(givenPython, nameOnly)
6668
return { binDir }
6769
}
6870
}
@@ -99,10 +101,16 @@ export async function setupPipPackWithPython(
99101
throw new Error(`Failed to install ${name} as it was not found via ${pip} or the system package manager`)
100102
}
101103

102-
const binDir = await finishPipPackageInstall(givenPython, nameOnly)
104+
const binDir = isPipx
105+
? await finishPipxPackageInstall()
106+
: await finishPipPackageInstall(givenPython, nameOnly)
103107
return { binDir }
104108
}
105109

110+
function finishPipxPackageInstall() {
111+
return getPipxBinDir()
112+
}
113+
106114
async function finishPipPackageInstall(givenPython: string, name: string) {
107115
const pythonBaseExecPrefix = await addPythonBaseExecPrefix(givenPython)
108116
const binDir = await findBinDir(pythonBaseExecPrefix, name)

0 commit comments

Comments
 (0)