From 71b1ccec3fe7d1bf9ab985150c3cde646a313093 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Sun, 25 Dec 2022 10:03:54 +0000 Subject: [PATCH] Update 2 files - /home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.tmpl - /home/dot_local/bin/executable_install-program --- .../run_onchange_after_12-install-packages.tmpl | 4 ---- home/dot_local/bin/executable_install-program | 14 +++++++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.tmpl index 805709cc..1ad221ff 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.tmpl @@ -14,10 +14,6 @@ if command -v install-program > /dev/null; then # Ask for the administrator password upfront logg info 'A sudo password may be required for some of the installations' sudo echo "Sudo access granted." - if ! command -v pipx > /dev/null && [ -f "$HOME/.bashrc" ]; then - logg info 'Sourcing ~/.bashrc to ensure PATHs are set up correctly' - . "$HOME/.bashrc" - fi install-program {{ index .softwareGroups $softwareGroup | toString | replace "[" "" | replace "]" "" }} else logg error '`zx` is not available' diff --git a/home/dot_local/bin/executable_install-program b/home/dot_local/bin/executable_install-program index cb3d4c56..49dba401 100644 --- a/home/dot_local/bin/executable_install-program +++ b/home/dot_local/bin/executable_install-program @@ -499,7 +499,7 @@ async function ensurePackage(dep) { const pacman = which.sync('pacman', { nothrow: true }) const zypper = which.sync('zypper', { nothrow: true }) if (apk) { - $`sudo apk add ${dep}` + await $`sudo apk add ${dep}` } else if (apt) { if (updateDone[packageManager] !== true) { await beforeInstall('apt-get') @@ -661,11 +661,11 @@ async function ensureInstalled(bin, callback) { } async function ensurePackageManagerAnsible() { - await $`pipx install ansible` + await $`pipx install ansible-core` if (osType === 'darwin') { - await $`pipx inject ansible PyObjC PyObjC-core` + await $`pipx inject ansible-core PyObjC PyObjC-core` } - await $`pipx inject ansible docker lxml netaddr pexpect python-vagrant pywinrm requests-credssp watchdog` + await $`pipx inject ansible-core docker lxml netaddr pexpect python-vagrant pywinrm requests-credssp watchdog` await $`mkdir -p "$HOME/.cache/megabyte-labs"` await $`touch "$HOME/.cache/megabyte-labs/ansible-installed"` log('info', 'Package Manager Install', `Ansible and its supporting packages are now installed via pipx`) @@ -806,9 +806,9 @@ async function ensurePackageManager(packageManager) { const pacman = which.sync('pacman', { nothrow: true }) const zypper = which.sync('zypper', { nothrow: true }) if (apk) { - $`sudo apk add flatpak` + await $`sudo apk add flatpak` } else if (apt) { - $` + await $` sudo apt install -y flatpak if [ -f /usr/bin/gnome-shell ]; then sudo apt install -y gnome-software-plugin-flatpak @@ -955,7 +955,7 @@ async function ensurePackageManager(packageManager) { } const snap = which.sync('snap', { nothrow: true }) if (snap) { - $`sudo snap install core` + await $`sudo snap install core` } else { log('warn', logStage, 'Snap installation sequence completed but the snap bin is still not available') }