From 5d2d8366dea4fa07bcf7e88f278727163c9904d2 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Mon, 5 Dec 2022 20:25:46 +0000 Subject: [PATCH] Update .local/share/chezmoi/home/dot_local/bin/executable_install-program --- .../dot_local/bin/executable_install-program | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 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 8161d1b3..59564ae5 100644 --- a/.local/share/chezmoi/home/dot_local/bin/executable_install-program +++ b/.local/share/chezmoi/home/dot_local/bin/executable_install-program @@ -867,12 +867,27 @@ async function ensurePackageManager(packageManager) { } else if (packageManager === "pkg") { await ensureInstalled("pkg", false); } else if (packageManager === "port") { - await ensureInstalled( - "port", - $` - echo -n "TODO - script that installs port on macOS here" - ` - ); + const port = which.sync('port', { nothrow: true }) + if (!port) { + log('info', logStage, `Installing ${packageManager}`) + await ensureInstalled( + "port", + $` + sudo mkdir -p /opt/mports + cd /opt/mports + sudo git clone https://github.com/macports/macports-base.git + cd macports-base + sudo git checkout v2.8.0 + ./configure --enable-readline + make + sudo make install + make distclean + ` + ); + log('info', logStage, `${packageManager} is now installed`) + } else { + log("info", logStage, `\`port\` is available`); + } } else if (packageManager === "scoop") { await ensureInstalled( "scoop",