fix: fix the pipx packages bin directory

This commit is contained in:
Amin Yahyaabadi 2024-09-18 17:04:40 -07:00
parent 4d73853d57
commit c9bc540d32
No known key found for this signature in database
GPG Key ID: F52AF77F636088F0
5 changed files with 14 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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 }
}
}
@ -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)