Update .local/share/chezmoi/home/dot_local/bin/executable_install-program

This commit is contained in:
Brian Zalewski 2022-12-02 23:15:45 +00:00
parent c9362d6b60
commit 6dbe7c5869

View file

@ -630,33 +630,47 @@ async function installPackageList(packageManager, packages) {
try {
if (packageManager === 'appimage') {
} else if (packageManager === 'ansible') {
for (const role of packages) {
execSync('gum spin --spinner dot --title "Installing ' + role + ' via Ansible" -- ansible localhost --skip-tags brew -m setup -m include_role -a name=' + role + ' -e ansible_user="$USER"', {stdio: 'inherit', shell: true})
for (let pkg of packages) {
execSync('gum spin --spinner dot --title "Installing ' + pkg + ' via Ansible" -- ansible localhost --skip-tags brew -m setup -m include_role -a name=' + pkg + ' -e ansible_user="$USER"', {stdio: 'inherit', shell: true})
}
} else if (packageManager === 'apk') {
await $`sudo apk add ${packages}`
for (let pkg of packages) {
await $`sudo apk add ${packages}`
}
} else if (packageManager === 'apt') {
await $`sudo apt-get install -y ${packages}`
for (let pkg of packages) {
await $`sudo apt-get install -y ${pkg}`
}
} else if (packageManager === 'basher') {
} else if (packageManager === 'binary') {
} else if (packageManager === 'brew') {
await $`brew install ${packages}`
for (let pkg of packages) {
await $`brew install ${pkg}`
}
} else if (packageManager === 'cask') {
await $`brew install --cask ${packages}`
for (let pkg of packages) {
await $`brew install --cask ${pkg}`
}
} else if (packageManager === 'cargo') {
for (const pkg of packages) {
await $`cargo install ${pkg}`
}
} else if (packageManager === 'choco') {
await $`choco install -y ${packages}`
for (let pkg of packages) {
await $`choco install -y ${pkg}`
}
} else if (packageManager === 'crew') {
} else if (packageManager === 'dnf') {
const dnf = which.sync('dnf', { nothrow: true })
const yum = which.sync('yum', { nothrow: true })
if (dnf) {
await $`dnf install -y ${packages}`
for (let pkg of packages) {
await $`sudo dnf install -y ${pkg}`
}
} else if (yum) {
await $`yum install -y ${packages}`
for (let pkg of packages) {
await $`sudo yum install -y ${pkg}`
}
}
} else if (packageManager === 'flatpak') {
for (let pkg of packages) {
@ -676,7 +690,9 @@ async function installPackageList(packageManager, packages) {
await $`volta install ${pkg}`
}
} else if (packageManager === 'pacman') {
await $`sudo pacman -Sy --noconfirm --needed ${packages}`
for (let pkg of packages) {
await $`sudo pacman -Sy --noconfirm --needed ${pkg}`
}
} else if (packageManager === 'pipx') {
for (let pkg of packages) {
await $`pipx install ${pkg}`
@ -704,7 +720,9 @@ async function installPackageList(packageManager, packages) {
await $`yay -Sy --noconfirm --needed ${pkg}`
}
} else if (packageManager === 'zypper') {
await $`sudo zypper install -y ${packages}`
for (let pkg of packages) {
await $`sudo zypper install -y ${packages}`
}
}
} catch (e) {
log('error', 'Package Install', `Possibly encountered an error while installing via \`${packageManager}\``)