From 3cbac5be2f143cb25d3fd479f0882503f4982610 Mon Sep 17 00:00:00 2001 From: Vincent Boutour Date: Mon, 25 Nov 2024 15:04:23 +0100 Subject: [PATCH] feat: Adding golang installation Signed-off-by: Vincent Boutour --- installations/docker.sh | 6 +++--- installations/golang.sh | 8 ++++---- installations/jetbrains.sh | 17 +++++++++++++++++ installations/node.sh | 4 ++-- installations/python.sh | 6 +++--- installations/sublime.sh | 6 +++--- sources/jetbrains.sh | 5 +++++ 7 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 installations/jetbrains.sh create mode 100644 sources/jetbrains.sh diff --git a/installations/docker.sh b/installations/docker.sh index d2d031b1..9628009b 100644 --- a/installations/docker.sh +++ b/installations/docker.sh @@ -21,9 +21,9 @@ clean() { sudo rm -rf "${HOME}/.docker" "${HOME}/.lima" "${HOME}/.colima" - if ! [[ ${OSTYPE} =~ ^darwin ]]; then - rm-rf "${HOME}/Library/Caches/colima" - rm-rf "${HOME}/Library/Caches/lima" + if [[ ${OSTYPE} =~ ^darwin ]]; then + rm -rf "${HOME}/Library/Caches/colima" + rm -rf "${HOME}/Library/Caches/lima" fi } diff --git a/installations/golang.sh b/installations/golang.sh index 3b552801..ce823ac1 100644 --- a/installations/golang.sh +++ b/installations/golang.sh @@ -23,10 +23,10 @@ clean() { rm -rf "${HOME}/.dlv" rm -rf "${HOME}/pprof" - if ! [[ ${OSTYPE} =~ ^darwin ]]; then - rm-rf "${HOME}/Library/Caches/go-build" - rm-rf "${HOME}/Library/Caches/golangci-lint" - rm-rf "${HOME}/Library/Caches/gopls" + if [[ ${OSTYPE} =~ ^darwin ]]; then + rm -rf "${HOME}/Library/Caches/go-build" + rm -rf "${HOME}/Library/Caches/golangci-lint" + rm -rf "${HOME}/Library/Caches/gopls" fi } diff --git a/installations/jetbrains.sh b/installations/jetbrains.sh new file mode 100644 index 00000000..397488d1 --- /dev/null +++ b/installations/jetbrains.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -o nounset -o pipefail -o errexit + +clean() { + if command -v gpgconf >/dev/null 2>&1; then + gpgconf --kill gpg-agent + fi +} + +install() { + packages_install "goland" + + if [[ ${OSTYPE} =~ ^darwin ]]; then + rm -rf "${HOME}/Library/JetBrains" + fi +} diff --git a/installations/node.sh b/installations/node.sh index 700d0ca8..7a44fc09 100644 --- a/installations/node.sh +++ b/installations/node.sh @@ -25,8 +25,8 @@ clean() { rm -rf "${HOME}/.npm" rm -rf "${HOME}/.v8flags."* - if ! [[ ${OSTYPE} =~ ^darwin ]]; then - rm-rf "${HOME}/Library/Caches/Yarn" + if [[ ${OSTYPE} =~ ^darwin ]]; then + rm -rf "${HOME}/Library/Caches/Yarn" fi } diff --git a/installations/python.sh b/installations/python.sh index b83418e1..687d2b07 100644 --- a/installations/python.sh +++ b/installations/python.sh @@ -17,9 +17,9 @@ script_dir() { clean() { rm -rf "${HOME}/.python_history" - if ! [[ ${OSTYPE} =~ ^darwin ]]; then - rm-rf "${HOME}/Library/Caches/pip" - rm-rf "${HOME}/Library/Caches/pip-tools" + if [[ ${OSTYPE} =~ ^darwin ]]; then + rm -rf "${HOME}/Library/Caches/pip" + rm -rf "${HOME}/Library/Caches/pip-tools" fi } diff --git a/installations/sublime.sh b/installations/sublime.sh index 6a4d88d2..f04c29ad 100644 --- a/installations/sublime.sh +++ b/installations/sublime.sh @@ -15,9 +15,9 @@ script_dir() { } clean() { - if ! [[ ${OSTYPE} =~ ^darwin ]]; then - rm-rf "${HOME}/Library/Caches/Sublime Text" - rm-rf "${HOME}/Library/Caches/Sublime Merge" + if [[ ${OSTYPE} =~ ^darwin ]]; then + rm -rf "${HOME}/Library/Caches/Sublime Text" + rm -rf "${HOME}/Library/Caches/Sublime Merge" fi } diff --git a/sources/jetbrains.sh b/sources/jetbrains.sh new file mode 100644 index 00000000..36b1fea4 --- /dev/null +++ b/sources/jetbrains.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +if [[ -d "/Applications/GoLand.app/Contents/MacOS" ]]; then + export PATH="/Applications/GoLand.app/Contents/MacOS:${PATH}" +fi