From c8369e5d4b6219d8644aaf74974ccfc9aa5ba0ff Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Tue, 6 Dec 2022 21:04:49 +0000 Subject: [PATCH] Update .local/share/chezmoi/home/dot_local/bin/executable_install-program --- .../home/dot_local/bin/executable_install-program | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 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 3dbf26c8..2ff75414 100644 --- a/.local/share/chezmoi/home/dot_local/bin/executable_install-program +++ b/.local/share/chezmoi/home/dot_local/bin/executable_install-program @@ -543,7 +543,12 @@ async function beforeInstall(packageManager) { ); await $`echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR ANSIBLE INSTALL" | sudo tee -a`; log('info', logStage, 'Running Ansible setup task so facts are cached') - await $`ansible 127.0.0.1 -vv -e '{ ansible_connection: "local", ansible_user: "${process.env.USER}", install_homebrew: False }' -m setup`; + const unbuffer = which.sync('unbuffer', { nothrow: true }) + let unbufferPrefix = '' + if (unbuffer) { + unbufferPrefix = 'unbuffer ' + } + await $`${unbufferPrefix}ansible 127.0.0.1 -vv -e '{ ansible_connection: "local", ansible_user: "${process.env.USER}", install_homebrew: False }' -m setup`; } else if (packageManager === "apk") { await $`sudo apk update`; } else if (packageManager === "apt") { @@ -988,7 +993,12 @@ async function installPackageList(packageManager, packages) { } else if (packageManager === "ansible") { for (let pkg of packages) { try { - await $`ansible 127.0.0.1 -vv -e '{ ansible_connection: "local", ansible_user: "${process.env.USER}", install_homebrew: False }' -m include_role -a name=${pkg}`; + const unbuffer = which.sync('unbuffer', { nothrow: true }) + let unbufferPrefix = '' + if (unbuffer) { + unbufferPrefix = 'unbuffer ' + } + await $`${unbufferPrefix}ansible 127.0.0.1 -vv -e '{ ansible_connection: "local", ansible_user: "${process.env.USER}", install_homebrew: False }' -m include_role -a name=${pkg}`; } catch (e) { log( "error",