From ca3364b2bcad2e4c6e6850dad76f3c53a646ae88 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 4 May 2022 22:35:13 +0700 Subject: [PATCH] add crystal --- bash/.bashrc | 1 + scripts/crystal.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 scripts/crystal.sh diff --git a/bash/.bashrc b/bash/.bashrc index 2f69f3b..04f24a3 100755 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -148,3 +148,4 @@ eval "$(starship init bash)" #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! [[ -s "/home/reinaldy/.sdkman/bin/sdkman-init.sh" ]] && source "/home/reinaldy/.sdkman/bin/sdkman-init.sh" +. "$HOME/.cargo/env" diff --git a/scripts/crystal.sh b/scripts/crystal.sh new file mode 100644 index 0000000..ed616ff --- /dev/null +++ b/scripts/crystal.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +function install () { + curl -fsSL https://crystal-lang.org/install.sh | sudo bash + sudo apt-get update + sudo apt-get install -y crystal libssl-dev libxml2-dev libyaml-dev libgmp-dev libz-dev +} + +function uninstall () { + sudo apt-get remove -y crystal +} + +if [ "$1" == "install" ]; then + install +elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then + uninstall +else + echo "please specify args with install or uninstall" +fi