Update 2 files
- /home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.tmpl - /home/dot_local/bin/executable_install-program
This commit is contained in:
parent
a249a2caee
commit
71b1ccec3f
2 changed files with 7 additions and 11 deletions
|
@ -14,10 +14,6 @@ if command -v install-program > /dev/null; then
|
||||||
# Ask for the administrator password upfront
|
# Ask for the administrator password upfront
|
||||||
logg info 'A sudo password may be required for some of the installations'
|
logg info 'A sudo password may be required for some of the installations'
|
||||||
sudo echo "Sudo access granted."
|
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 "]" "" }}
|
install-program {{ index .softwareGroups $softwareGroup | toString | replace "[" "" | replace "]" "" }}
|
||||||
else
|
else
|
||||||
logg error '`zx` is not available'
|
logg error '`zx` is not available'
|
||||||
|
|
|
@ -499,7 +499,7 @@ async function ensurePackage(dep) {
|
||||||
const pacman = which.sync('pacman', { nothrow: true })
|
const pacman = which.sync('pacman', { nothrow: true })
|
||||||
const zypper = which.sync('zypper', { nothrow: true })
|
const zypper = which.sync('zypper', { nothrow: true })
|
||||||
if (apk) {
|
if (apk) {
|
||||||
$`sudo apk add ${dep}`
|
await $`sudo apk add ${dep}`
|
||||||
} else if (apt) {
|
} else if (apt) {
|
||||||
if (updateDone[packageManager] !== true) {
|
if (updateDone[packageManager] !== true) {
|
||||||
await beforeInstall('apt-get')
|
await beforeInstall('apt-get')
|
||||||
|
@ -661,11 +661,11 @@ async function ensureInstalled(bin, callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function ensurePackageManagerAnsible() {
|
async function ensurePackageManagerAnsible() {
|
||||||
await $`pipx install ansible`
|
await $`pipx install ansible-core`
|
||||||
if (osType === 'darwin') {
|
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 $`mkdir -p "$HOME/.cache/megabyte-labs"`
|
||||||
await $`touch "$HOME/.cache/megabyte-labs/ansible-installed"`
|
await $`touch "$HOME/.cache/megabyte-labs/ansible-installed"`
|
||||||
log('info', 'Package Manager Install', `Ansible and its supporting packages are now installed via pipx`)
|
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 pacman = which.sync('pacman', { nothrow: true })
|
||||||
const zypper = which.sync('zypper', { nothrow: true })
|
const zypper = which.sync('zypper', { nothrow: true })
|
||||||
if (apk) {
|
if (apk) {
|
||||||
$`sudo apk add flatpak`
|
await $`sudo apk add flatpak`
|
||||||
} else if (apt) {
|
} else if (apt) {
|
||||||
$`
|
await $`
|
||||||
sudo apt install -y flatpak
|
sudo apt install -y flatpak
|
||||||
if [ -f /usr/bin/gnome-shell ]; then
|
if [ -f /usr/bin/gnome-shell ]; then
|
||||||
sudo apt install -y gnome-software-plugin-flatpak
|
sudo apt install -y gnome-software-plugin-flatpak
|
||||||
|
@ -955,7 +955,7 @@ async function ensurePackageManager(packageManager) {
|
||||||
}
|
}
|
||||||
const snap = which.sync('snap', { nothrow: true })
|
const snap = which.sync('snap', { nothrow: true })
|
||||||
if (snap) {
|
if (snap) {
|
||||||
$`sudo snap install core`
|
await $`sudo snap install core`
|
||||||
} else {
|
} else {
|
||||||
log('warn', logStage, 'Snap installation sequence completed but the snap bin is still not available')
|
log('warn', logStage, 'Snap installation sequence completed but the snap bin is still not available')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue