Created
April 11, 2024 18:55
-
-
Save dyhalmeida/d25b485152612320a301f698d7948f2c to your computer and use it in GitHub Desktop.
zsh alias to install golang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # function alias | |
| go_install(){ | |
| rm -rf /usr/local/go || { echo "Falha ao remover o diretório /usr/local/go"; return 1; } | |
| tar -C /usr/local -xzf "$1" || { echo "Falha ao extrair o arquivo tar"; return 1; } | |
| echo -n "Deseja atualizar o PATH para incluir /usr/local/go/bin? (y/n): " | |
| read update_path | |
| if [ "$update_path" = "y" ]; then | |
| echo -e '\n\nexport PATH=$PATH:/usr/local/go/bin' >> ~/.zshrc | |
| source ~/.zshrc | |
| fi | |
| echo "Go instalado com sucesso!" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment