diff --git a/cookbooks/vagrant/recipes/install.bash b/cookbooks/vagrant/recipes/install.bash new file mode 100755 index 0000000..02cce26 --- /dev/null +++ b/cookbooks/vagrant/recipes/install.bash @@ -0,0 +1,41 @@ +#!/bin/bash -e + +function installDependencies() +{ + if [[ "$(existCommand 'brew')" = 'false' ]] + then + "${APP_FOLDER_PATH}/../../brew/recipes/install.bash" + fi +} + +function install() +{ + initializeFolder "$(getCurrentUserHomeFolder)/Library/Caches/Homebrew" + + if [[ "$(existCommand 'java')" = 'true' ]] + then + brew cask reinstall 'vagrant' + else + brew cask install 'vagrant' + fi + + displayVersion "$(vagrant --version)" +} + +function main() +{ + APP_FOLDER_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + + source "${APP_FOLDER_PATH}/../../../libraries/util.bash" + + checkRequireMacSystem + + header 'INSTALLING VAGRANT' + + # Install + + installDependencies + install +} + +main "${@}" \ No newline at end of file diff --git a/cookbooks/vagrant/recipes/uninstall.bash b/cookbooks/vagrant/recipes/uninstall.bash new file mode 100755 index 0000000..21ef4f7 --- /dev/null +++ b/cookbooks/vagrant/recipes/uninstall.bash @@ -0,0 +1,26 @@ +#!/bin/bash -e + +function uninstall() +{ + if [[ "$(existCommand 'brew')" = 'true' ]] + then + brew cask uninstall 'vagrant' || true + fi +} + +function main() +{ + APP_FOLDER_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + + source "${APP_FOLDER_PATH}/../../../libraries/util.bash" + + checkRequireMacSystem + + header 'INSTALLING VAGRANT' + + # Uninstall + + uninstall +} + +main "${@}" \ No newline at end of file diff --git a/roles/nam/roles/macbook-pro-cli.bash b/roles/nam/roles/macbook-pro-cli.bash index 6fef884..af50fd5 100755 --- a/roles/nam/roles/macbook-pro-cli.bash +++ b/roles/nam/roles/macbook-pro-cli.bash @@ -12,6 +12,7 @@ function main() sudo -u "${SUDO_USER}" "${appFolderPath}/../../../cookbooks/chef-client/recipes/install.bash" sudo -u "${SUDO_USER}" "${appFolderPath}/../../../cookbooks/jdk/recipes/install.bash" sudo -u "${SUDO_USER}" "${appFolderPath}/../../../cookbooks/shell-check/recipes/install.bash" + sudo -u "${SUDO_USER}" "${appFolderPath}/../../../cookbooks/vagrant/recipes/install.bash" # Non-Brew Applications