Update .local/share/chezmoi/home/dot_local/bin/executable_install-program
This commit is contained in:
parent
c9362d6b60
commit
6dbe7c5869
1 changed files with 29 additions and 11 deletions
|
@ -630,33 +630,47 @@ async function installPackageList(packageManager, packages) {
|
||||||
try {
|
try {
|
||||||
if (packageManager === 'appimage') {
|
if (packageManager === 'appimage') {
|
||||||
} else if (packageManager === 'ansible') {
|
} else if (packageManager === 'ansible') {
|
||||||
for (const role of packages) {
|
for (let pkg 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})
|
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') {
|
} else if (packageManager === 'apk') {
|
||||||
await $`sudo apk add ${packages}`
|
for (let pkg of packages) {
|
||||||
|
await $`sudo apk add ${packages}`
|
||||||
|
}
|
||||||
} else if (packageManager === 'apt') {
|
} 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 === 'basher') {
|
||||||
} else if (packageManager === 'binary') {
|
} else if (packageManager === 'binary') {
|
||||||
} else if (packageManager === 'brew') {
|
} else if (packageManager === 'brew') {
|
||||||
await $`brew install ${packages}`
|
for (let pkg of packages) {
|
||||||
|
await $`brew install ${pkg}`
|
||||||
|
}
|
||||||
} else if (packageManager === 'cask') {
|
} else if (packageManager === 'cask') {
|
||||||
await $`brew install --cask ${packages}`
|
for (let pkg of packages) {
|
||||||
|
await $`brew install --cask ${pkg}`
|
||||||
|
}
|
||||||
} else if (packageManager === 'cargo') {
|
} else if (packageManager === 'cargo') {
|
||||||
for (const pkg of packages) {
|
for (const pkg of packages) {
|
||||||
await $`cargo install ${pkg}`
|
await $`cargo install ${pkg}`
|
||||||
}
|
}
|
||||||
} else if (packageManager === 'choco') {
|
} 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 === 'crew') {
|
||||||
} else if (packageManager === 'dnf') {
|
} else if (packageManager === 'dnf') {
|
||||||
const dnf = which.sync('dnf', { nothrow: true })
|
const dnf = which.sync('dnf', { nothrow: true })
|
||||||
const yum = which.sync('yum', { nothrow: true })
|
const yum = which.sync('yum', { nothrow: true })
|
||||||
if (dnf) {
|
if (dnf) {
|
||||||
await $`dnf install -y ${packages}`
|
for (let pkg of packages) {
|
||||||
|
await $`sudo dnf install -y ${pkg}`
|
||||||
|
}
|
||||||
} else if (yum) {
|
} else if (yum) {
|
||||||
await $`yum install -y ${packages}`
|
for (let pkg of packages) {
|
||||||
|
await $`sudo yum install -y ${pkg}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (packageManager === 'flatpak') {
|
} else if (packageManager === 'flatpak') {
|
||||||
for (let pkg of packages) {
|
for (let pkg of packages) {
|
||||||
|
@ -676,7 +690,9 @@ async function installPackageList(packageManager, packages) {
|
||||||
await $`volta install ${pkg}`
|
await $`volta install ${pkg}`
|
||||||
}
|
}
|
||||||
} else if (packageManager === 'pacman') {
|
} 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') {
|
} else if (packageManager === 'pipx') {
|
||||||
for (let pkg of packages) {
|
for (let pkg of packages) {
|
||||||
await $`pipx install ${pkg}`
|
await $`pipx install ${pkg}`
|
||||||
|
@ -704,7 +720,9 @@ async function installPackageList(packageManager, packages) {
|
||||||
await $`yay -Sy --noconfirm --needed ${pkg}`
|
await $`yay -Sy --noconfirm --needed ${pkg}`
|
||||||
}
|
}
|
||||||
} else if (packageManager === 'zypper') {
|
} else if (packageManager === 'zypper') {
|
||||||
await $`sudo zypper install -y ${packages}`
|
for (let pkg of packages) {
|
||||||
|
await $`sudo zypper install -y ${packages}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('error', 'Package Install', `Possibly encountered an error while installing via \`${packageManager}\``)
|
log('error', 'Package Install', `Possibly encountered an error while installing via \`${packageManager}\``)
|
||||||
|
|
Loading…
Reference in a new issue