Update file executable_install-program

This commit is contained in:
Brian Zalewski 2023-01-04 07:33:00 +00:00
parent 29a8c9d235
commit 089bd0dd8b

View file

@ -1316,7 +1316,7 @@ async function updateSystemd(service) {
async function pruneInstallOrders(installOrders) { async function pruneInstallOrders(installOrders) {
const newOrders = Object.assign({}, installOrders) const newOrders = Object.assign({}, installOrders)
for (const pkgManager in installOrders) { for (const pkgManager of installOrders) {
if (pkgManager === 'apt') { if (pkgManager === 'apt') {
newOrders[pkgManager] = newOrders[pkgManager].filter(async x => { newOrders[pkgManager] = newOrders[pkgManager].filter(async x => {
try { try {
@ -1327,14 +1327,15 @@ async function pruneInstallOrders(installOrders) {
} }
}) })
} else if (pkgManager === 'brew') { } else if (pkgManager === 'brew') {
newOrders[pkgManager] = newOrders[pkgManager].filter(async x => { let newVal = newOrders[pkgManager]
for (const pkg in newOrders[pkgManager]) {
try { try {
await $`brew list ${pkg}` await $`brew list ${pkg}`
return true
} catch (e) { } catch (e) {
return false // Do nothing
} }
}) }
newOrders[pkgManager] = newVal
} else if (pkgManager === 'dnf') { } else if (pkgManager === 'dnf') {
const dnf = which.sync('dnf', { nothrow: true }) const dnf = which.sync('dnf', { nothrow: true })
newOrders[pkgManager] = newOrders[pkgManager].filter(async x => { newOrders[pkgManager] = newOrders[pkgManager].filter(async x => {