Update file executable_install-program

This commit is contained in:
Brian Zalewski 2023-01-09 05:30:07 +00:00
parent 67e115939f
commit 255fe69345

View file

@ -1097,7 +1097,7 @@ async function installPackageList(packageManager, packages) {
log('success', 'Install', `${pkg} successfully installed via ${packageManager}`) log('success', 'Install', `${pkg} successfully installed via ${packageManager}`)
} catch (e) { } catch (e) {
log('error', 'Install Failure', `There was an error installing ${pkg} with apk`) log('error', 'Install Failure', `There was an error installing ${pkg} with apk`)
console.log(e) console.error(e)
} }
} }
} else if (packageManager === 'apt') { } else if (packageManager === 'apt') {
@ -1206,7 +1206,6 @@ async function installPackageList(packageManager, packages) {
try { try {
runCommand(`Installing ${pkg} via ${packageManager}`, `gem install ${pkg}`) runCommand(`Installing ${pkg} via ${packageManager}`, `gem install ${pkg}`)
log('success', 'Install', `${pkg} successfully installed via ${packageManager}`) log('success', 'Install', `${pkg} successfully installed via ${packageManager}`)
await $`gem install ${pkg}`
} catch (e) { } catch (e) {
log('error', 'Install Failure', `There was an error installing ${pkg} with gem`) log('error', 'Install Failure', `There was an error installing ${pkg} with gem`)
console.error(e) console.error(e)
@ -1365,8 +1364,8 @@ async function updateService(service) {
const systemctl = which.sync('systemctl', { nothrow: true }) const systemctl = which.sync('systemctl', { nothrow: true })
if (systemctl) { if (systemctl) {
try { try {
log('info', logStage, `Starting / enabling the ${service} service`) runCommand(`Starting / enabling ${service} with systemctl`, `sudo systemctl enable --now ${service}`)
await $`sudo systemctl enable --now ${service}` log('success', logStage, `Started / enabled the ${service} service`)
} catch (e) { } catch (e) {
log('error', logStage, `There was an error starting / enabling the ${service} service`) log('error', logStage, `There was an error starting / enabling the ${service} service`)
console.error(e) console.error(e)
@ -1382,8 +1381,8 @@ async function updateService(service) {
const brew = which.sync('brew', { nothrow: true }) const brew = which.sync('brew', { nothrow: true })
if (brew) { if (brew) {
try { try {
log('info', logStage, `Starting / enabling the ${service} service with Homebrew`) runCommand(`Starting / enabling ${service} with Homebrew`, `brew services start ${service}`)
await $`brew services start ${service}` log('success', logStage, `Started / enabled the ${service} service with Homebrew`)
} catch (e) { } catch (e) {
log('error', logStage, `There was an error starting / enabling the ${service} Homebrew service`) log('error', logStage, `There was an error starting / enabling the ${service} Homebrew service`)
console.error(e) console.error(e)
@ -1445,11 +1444,10 @@ async function pruneInstallOrders(installOrders) {
}) })
} else if (pkgManager === 'flatpak') { } else if (pkgManager === 'flatpak') {
const flatpakInstallation = await $`flatpak --installations` const flatpakInstallation = await $`flatpak --installations`
console.log('RIGHT HERE') const flatpakDir = flatpakInstallation.stdout.replace('\\n', '')
console.log(flatpakInstallation)
newOrders[pkgManager] = await asyncFilter(newOrders[pkgManager], async (pkg) => { newOrders[pkgManager] = await asyncFilter(newOrders[pkgManager], async (pkg) => {
try { try {
await runSilentCommand(`test -d ${flatpakInstallation}/app/${pkg}`) await runSilentCommand(`test -d ${flatpakDir}/app/${pkg}`)
return false return false
} catch (e) { } catch (e) {
return true return true