Update 3 files

- /home/.chezmoidata.yaml
- /home/dot_local/bin/executable_install-program
- /software.yml
This commit is contained in:
Brian Zalewski 2023-01-09 09:31:22 +00:00
parent e86c0d6ffe
commit f0d55fbb76
3 changed files with 17 additions and 11 deletions

View file

@ -559,7 +559,8 @@ softwareGroups:
- netdata
- samba
- sftpgo
- vector
# Headless install needs work since it is run via script
# - vector
- wazuh
Shell-Scripting: &Shell-Scripting
- shc

View file

@ -86,6 +86,7 @@ function fileExists(pathToFile) {
let installData
let installOrders = {}
let binLinkRan = false
const installOrdersPre = []
const installOrdersPost = []
const installOrdersService = []
@ -1100,8 +1101,8 @@ async function installPackageList(packageManager, packages) {
if (unbuffer) {
unbufferPrefix = 'unbuffer'
}
const verboseMode = process.env.DEBUG_MODE === 'on' ? '-vvv' : ''
await $`ANSIBLE_CONFIG=${process.env.HOME}/.local/share/ansible/ansible.cfg ansible 127.0.0.1 ${verboseMode} -e '{ ansible_connection: "local", ansible_become_user: "root", ansible_user: "${process.env.USER}", install_homebrew: False }' -m include_role -a name=${pkg}`
const verboseMode = process.env.DEBUG_MODE === 'on' ? 'vv' : ''
await $`ANSIBLE_CONFIG=${process.env.HOME}/.local/share/ansible/ansible.cfg ansible 127.0.0.1 -v${verboseMode} -e '{ ansible_connection: "local", ansible_become_user: "root", ansible_user: "${process.env.USER}", install_homebrew: False }' -m include_role -a name=${pkg}`
log('success', 'Install', `${pkg} successfully installed via ${packageManager}`)
} catch (e) {
log('error', 'Install Failure', `There was an error installing ${pkg} with Ansible`)
@ -1528,10 +1529,10 @@ async function linkBin(installOrdersBinLink) {
}
for (const binLink of installOrdersBinLink) {
const pkg = softwarePackages[binLink.package][binLink.preference]
if(!which.sync(binLink.bin, { nothrow: true })) {
if(typeof binLink.bin === 'string' && !which.sync(binLink.bin, { nothrow: true })) {
if (binLink.preference === 'flatpak' && flatpak) {
try {
runCommand(`Adding bin link for ${pkg} (${binLink.bin})`, `bash -c 'test -d ${flatpakDir}/app/${pkg} && mkdir -p "${process.env.HOME}/.local/bin/flatpak" && echo "flatpak run ${pkg}" > "${process.env.HOME}/.local/bin/flatpak/${binLink.bin}"'`)
runCommand(`Adding bin link for ${pkg} (${binLink.bin})`, `bash -c 'test -d ${flatpakDir}/app/${pkg} && mkdir -p "${process.env.HOME}/.local/bin/flatpak" && echo "flatpak run ${pkg} \"$*\"" > "${process.env.HOME}/.local/bin/flatpak/${binLink.bin}"'`)
log('success', 'Bin', `Linked ~/.local/bin/flatpak/${binLink.bin} to the ${pkg} Flatpak`)
} catch (e) {
log('warn', 'Bin', `Expected flatpak directory not available - ${flatpakDir}/app/${pkg}`)
@ -1604,15 +1605,18 @@ async function installSoftware(pkgsToInstall) {
for (const service of installOrdersService) {
await updateService(service)
}
if (!binLinkRan) {
binLinkRan = true
log('info', 'Bin', 'Linking bin aliases to their installed packages')
await linkBin(installOrdersBinLink)
for (const script of installOrdersPost) {
await $`${script}`
}
}
log('info', 'Plugin', 'Installing package-specific plugins')
for (const plugin of installOrdersPlugins) {
await installPlugins(plugin)
}
log('info', 'Bin', 'Linking bin aliases to their installed packages')
await linkBin(installOrdersBinLink)
for (const script of installOrdersPost) {
await $`${script}`
}
log('info', 'Post-Install', `Running package manager post-installation steps`)
for (const packageManager of packageManagers) {
await afterInstall(packageManager)

View file

@ -6761,6 +6761,7 @@ softwarePackages:
_name: Vagrant
_snapClassic: true
ansible: professormanhattan.vagrant
apt: vagrant
brew: hashicorp/tap/vagrant
choco: vagrant
dnf: vagrant
@ -6974,7 +6975,7 @@ softwarePackages:
ansible: professormanhattan.wails
go: github.com/wailsapp/wails/cmd/wails@latest
warp:
_bin: null
_bin: warp-cli
_desc: '[Cloudflare WARP Client](https://cloudflarewarp.com/) is a free app that makes your Internet safer'
_docs: null
_github: null