Skip to content

Commit 0528a87

Browse files
committed
fix: install pipx via pip too
1 parent 627f57a commit 0528a87

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

dist/legacy/setup-cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/python/python.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,22 @@ async function setupPipx(foundPython: string) {
6161
if (!(await hasPipxModule(foundPython))) {
6262
try {
6363
// first try with the system-wide pipx
64-
if ((await setupPipPackSystem("pipx", isArch())) === null) {
65-
// try with pip
66-
await setupPipPackWithPython(foundPython, "pipx", undefined, { upgrade: true, usePipx: false })
67-
}
64+
await setupPipPackSystem("pipx", isArch())
65+
// then install with the system-wide pipx
66+
await setupPipPackWithPython(foundPython, "pipx", undefined, { upgrade: true, usePipx: false })
6867
} catch (err) {
69-
throw new Error(`pipx was not installed correctly ${err}`)
68+
throw new Error(`pipx was not installed completely: ${err}`)
7069
}
7170
}
7271
if (await hasPipxModule(foundPython)) {
7372
await execa(foundPython, ["-m", "pipx", "ensurepath"], { stdio: "inherit" })
7473
return
7574
} else if (await hasPipxBinary()) {
75+
notice("pipx module not found. Trying to install with pipx binary...")
7676
await execa("pipx", ["ensurepath"], { stdio: "inherit" })
7777
return
7878
} else {
79-
notice("pipx module or pipx binary not found. Corrput pipx installation.")
79+
throw new Error("pipx module or pipx binary not found. Corrput pipx installation.")
8080
}
8181
} catch (err) {
8282
notice(`Failed to install pipx: ${(err as Error).toString()}. Ignoring...`)

0 commit comments

Comments
 (0)