From b883ffa0a680dac005a6a8db97c8a2af63a9349c Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Fri, 18 Aug 2023 14:11:14 -0400 Subject: [PATCH] Added plugin when capability --- home/dot_local/bin/executable_install-program | 16 +++++++++++++--- software.yml | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/home/dot_local/bin/executable_install-program b/home/dot_local/bin/executable_install-program index 1f4c1457..6fc7d2bd 100644 --- a/home/dot_local/bin/executable_install-program +++ b/home/dot_local/bin/executable_install-program @@ -1774,12 +1774,22 @@ async function installPlugins(pluginData) { for (const plugin of pluginData.plugins) { try { const pluginCmd = pluginData.cmd.replace(/{PLUGIN}/g, plugin) - runCommand(`Installing ${pluginData.package} plugin - ${plugin}`, pluginCmd) - log('success', 'Plugin', `Successfully installed ${pluginData.package} plugin - ${plugin}`) + const pluginWhen = pluginData.when + try { + if (pluginWhen) { + runCommand(`Checking when condition for ${pluginData.package} plugin - ${plugin}`, pluginWhen) + } + runCommand(`Installing ${pluginData.package} plugin - ${plugin}`, pluginCmd) + log('success', 'Plugin', `Successfully installed ${pluginData.package} plugin - ${plugin}`) + } catch (e) { + log('info', 'Plugin', `Failed to install ${pluginData.package} plugin - ${plugin}`) + console.error(e) + } } catch (e) { - log('error', 'Plugin', `Failed to install ${pluginData.package} plugin - ${plugin}`) + log('error', 'Plugin', `Failed to install ${pluginData.package} plugin - ${plugin`) console.error(e) } + } } if (pluginData.update) { diff --git a/software.yml b/software.yml index c82875a9..86976b89 100644 --- a/software.yml +++ b/software.yml @@ -10798,6 +10798,7 @@ softwarePlugins: - redhatdeveloper/openshift-dd-ext - snyk/snyk-docker-desktop-extension - tailscale/docker-extension:1.0.0 + when: docker extension &>2 /dev/null dockerImages: cmd: null plugins: