fix: log the pip fallback error

This commit is contained in:
Amin Yahyaabadi 2023-09-06 21:29:20 -07:00
parent ddbec096fd
commit 6af571471a
1 changed files with 3 additions and 1 deletions

View File

@ -58,8 +58,9 @@ export async function setupPipPackWithPython(
stdio: "inherit", stdio: "inherit",
}) })
} catch (err) { } catch (err) {
info(`Failed to install ${name} via ${pip}: ${err}.`)
if ((await setupPipPackSystem(name)) === null) { if ((await setupPipPackSystem(name)) === null) {
throw new Error(`Failed to install ${name} via ${pip} ${err}`) throw new Error(`Failed to install ${name} via ${pip}: ${err}.`)
} }
} }
@ -102,6 +103,7 @@ async function findBinDir(dirs: string[], name: string) {
export function setupPipPackSystem(name: string) { export function setupPipPackSystem(name: string) {
if (process.platform === "linux") { if (process.platform === "linux") {
info(`Installing ${name} via the system package manager`)
if (isArch()) { if (isArch()) {
return setupPacmanPack(`python-${name}`) return setupPacmanPack(`python-${name}`)
} else if (hasDnf()) { } else if (hasDnf()) {