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 - netdata
- samba - samba
- sftpgo - sftpgo
- vector # Headless install needs work since it is run via script
# - vector
- wazuh - wazuh
Shell-Scripting: &Shell-Scripting Shell-Scripting: &Shell-Scripting
- shc - shc

View file

@ -86,6 +86,7 @@ function fileExists(pathToFile) {
let installData let installData
let installOrders = {} let installOrders = {}
let binLinkRan = false
const installOrdersPre = [] const installOrdersPre = []
const installOrdersPost = [] const installOrdersPost = []
const installOrdersService = [] const installOrdersService = []
@ -1100,8 +1101,8 @@ async function installPackageList(packageManager, packages) {
if (unbuffer) { if (unbuffer) {
unbufferPrefix = 'unbuffer' unbufferPrefix = 'unbuffer'
} }
const verboseMode = process.env.DEBUG_MODE === 'on' ? '-vvv' : '' const verboseMode = process.env.DEBUG_MODE === 'on' ? 'vv' : ''
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}` 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}`) log('success', 'Install', `${pkg} successfully installed via ${packageManager}`)
} catch (e) { } catch (e) {
log('error', 'Install Failure', `There was an error installing ${pkg} with Ansible`) 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) { for (const binLink of installOrdersBinLink) {
const pkg = softwarePackages[binLink.package][binLink.preference] 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) { if (binLink.preference === 'flatpak' && flatpak) {
try { 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`) log('success', 'Bin', `Linked ~/.local/bin/flatpak/${binLink.bin} to the ${pkg} Flatpak`)
} catch (e) { } catch (e) {
log('warn', 'Bin', `Expected flatpak directory not available - ${flatpakDir}/app/${pkg}`) log('warn', 'Bin', `Expected flatpak directory not available - ${flatpakDir}/app/${pkg}`)
@ -1604,15 +1605,18 @@ async function installSoftware(pkgsToInstall) {
for (const service of installOrdersService) { for (const service of installOrdersService) {
await updateService(service) await updateService(service)
} }
log('info', 'Plugin', 'Installing package-specific plugins') if (!binLinkRan) {
for (const plugin of installOrdersPlugins) { binLinkRan = true
await installPlugins(plugin)
}
log('info', 'Bin', 'Linking bin aliases to their installed packages') log('info', 'Bin', 'Linking bin aliases to their installed packages')
await linkBin(installOrdersBinLink) await linkBin(installOrdersBinLink)
for (const script of installOrdersPost) { for (const script of installOrdersPost) {
await $`${script}` await $`${script}`
} }
}
log('info', 'Plugin', 'Installing package-specific plugins')
for (const plugin of installOrdersPlugins) {
await installPlugins(plugin)
}
log('info', 'Post-Install', `Running package manager post-installation steps`) log('info', 'Post-Install', `Running package manager post-installation steps`)
for (const packageManager of packageManagers) { for (const packageManager of packageManagers) {
await afterInstall(packageManager) await afterInstall(packageManager)

View file

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