diff --git a/VERSION b/VERSION index f8bc4c6..d8a023e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.18 +0.1.19 diff --git a/formula/ih-core.rb b/formula/ih-core.rb index daf0373..43917cb 100644 --- a/formula/ih-core.rb +++ b/formula/ih-core.rb @@ -1,5 +1,5 @@ class IhCore < Formula - VERSION="0.1.18" + VERSION="0.1.19" desc "Brew formula for installing core tools used at Included Health engineering." homepage "https://github.com/ConsultingMD/homebrew-ih-public" license "CC BY-NC-ND 4.0" diff --git a/lib/core/rancher/step.sh b/lib/core/rancher/step.sh index cf5901f..9552883 100644 --- a/lib/core/rancher/step.sh +++ b/lib/core/rancher/step.sh @@ -32,9 +32,28 @@ function ih::setup::core.rancher::install() { cp "${THIS_DIR}/io.rancherdesktop.profile.defaults.plist" "$HOME/Library/Preferences/io.rancherdesktop.profile.defaults.plist" - if command -v rdctl; then - rdctl shutdown + # Check if Rancher was installed manually + brew list rancher > /dev/null 2>&1 + RANCHERINSTALLED=$? + + #Check if IH Rancher is already installed + brew list ih-rancher > /dev/null 2>&1 + IHRANCHERINSTALLED=$? + + # If rancher or ih-rancher is already installed reset to factory + if [ $RANCHERINSTALLED -eq 0 ] || [ $IHRANCHERINSTALLED -eq 0 ] + then + $(/Applications/Rancher\ Desktop.app/Contents/Resources/resources/darwin/bin/rdctl factory-reset) fi + + # Check if Rancher was installed manually with brew + if [ $RANCHERINSTALLED -eq 0 ] + then + echo "Rancher Desktop was installed previously with brew command. In order to avoid any conflicts this script will uninstall that package". + echo "You may be required to enter your password" + brew uninstall rancher + fi + CASKSUCCEEDED=1 # Installation and configuration of Rancher Desktop