diff --git a/home/dot_local/bin/executable_install-program b/home/dot_local/bin/executable_install-program index e98a5998..8ca028d7 100644 --- a/home/dot_local/bin/executable_install-program +++ b/home/dot_local/bin/executable_install-program @@ -1529,29 +1529,33 @@ async function linkBin(installOrdersBinLink) { } for (const binLink of installOrdersBinLink) { const pkg = softwarePackages[binLink.package][binLink.preference] - if(typeof pkg === '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}" && chmod +x "${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}`) - } - } else if (binLink.preference === 'cask') { - try { - const caskWhen = softwarePackages[binLink.package]["_when:cask"] - const caskDir = caskWhen.replace('! test -d ', '').replace(/"/g, '') - if (fileExists(caskDir)) { - runCommand(`Adding shortcut bin link for ${binLink.package}`, `bash -c 'mkdir -p "${process.env.HOME}/.local/bin/cask" && echo "open ${caskDir}" > "${process.env.HOME}/.local/bin/cask/${binLink.bin}" && chmod +x "${process.env.HOME}/.local/bin/cask/${binLink.bin}"'`) - } else { - log('warn', 'Bin', `Expected Homebrew cask directory not found - ${pkg}`) + if(typeof pkg === 'string') { + if(!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}" && chmod +x "${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}`) + } + } else if (binLink.preference === 'cask') { + try { + const caskWhen = softwarePackages[binLink.package]["_when:cask"] + const caskDir = caskWhen.replace('! test -d ', '').replace(/"/g, '') + if (fileExists(caskDir)) { + runCommand(`Adding shortcut bin link for ${binLink.package}`, `bash -c 'mkdir -p "${process.env.HOME}/.local/bin/cask" && echo "open ${caskDir}" > "${process.env.HOME}/.local/bin/cask/${binLink.bin}" && chmod +x "${process.env.HOME}/.local/bin/cask/${binLink.bin}"'`) + } else { + log('warn', 'Bin', `Expected Homebrew cask directory not found - ${pkg}`) + } + } catch (e) { + log('warn', 'Bin', `Error creating bin shortcut link for ${pkg}`) } - } catch (e) { - log('warn', 'Bin', `Error creating bin shortcut link for ${pkg}`) } + } else { + log('info', 'Bin', `Link already exists for ${binLink.package}`) } } else { - log('info', 'Bin', `Link already exists for ${binLink.package}`) + log('info', 'Bin', `Skipping ${binLink.package} because there was more than one _bin value`) } } } diff --git a/software.yml b/software.yml index 4c7360d5..e7e09496 100644 --- a/software.yml +++ b/software.yml @@ -6902,7 +6902,8 @@ softwarePackages: flatpak: org.videolan.VLC snap: vlc vmware: - _bin: null + _bin: vmware + _bin:cask: vmware-id _desc: '[VMWare Workstation](https://www.vmware.com/products/workstation-pro.html) (or [VMWare Fusion](https://www.vmware.com/products/fusion.html) in the case of macOS) is a hosted hypervisor that runs on x64 versions of Windows and Linux operating systems. It enables users to set up virtual machines on a single physical machine and use them simultaneously along with the host machine. It is similar to [VirtualBox](https://gitlab.com/megabyte-labs/ansible-roles/virtualbox).' _docs: https://docs.vmware.com/ _github: Not open-source