From 961bd657345816cccb8b139c43f60d069c31ceed Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Mon, 5 Dec 2022 03:39:40 +0000 Subject: [PATCH] Update .local/share/chezmoi/home/dot_local/bin/executable_install-program --- .../home/dot_local/bin/executable_install-program | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.local/share/chezmoi/home/dot_local/bin/executable_install-program b/.local/share/chezmoi/home/dot_local/bin/executable_install-program index 4c26e590..a623545e 100644 --- a/.local/share/chezmoi/home/dot_local/bin/executable_install-program +++ b/.local/share/chezmoi/home/dot_local/bin/executable_install-program @@ -784,12 +784,17 @@ async function installPackageList(packageManager, packages) { } } else if (packageManager === 'pkg') { } else if (packageManager === 'port') { - for (let pkg of packages) { - try { - await $`sudo port install ${pkg}` - } catch(e) { - log('error', 'Port Failure', `There was an error installing ${pkg} with port`) + const port = which.sync('port', { nothrow: true }) + if (port) { + for (let pkg of packages) { + try { + await $`sudo port install ${pkg}` + } catch(e) { + log('error', 'Port Failure', `There was an error installing ${pkg} with port`) + } } + } else { + log('error', 'Port Not Installed', `Unable to install ${pkg} because port is not installed.`) } } else if (packageManager === 'scoop') { for (let pkg of packages) {