Last active
August 5, 2018 11:38
-
-
Save coelhoadler/a412941d84285805b20cb3ba531c3921 to your computer and use it in GitHub Desktop.
[WIP] Starting a .sh file to automate my developer environment.
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
| #!/bin/bash | |
| verify_git() { | |
| git --version | |
| } | |
| add_alias_git() { | |
| if [ "$#" -eq 1] | |
| then | |
| alias gst='git status' >> $1 | |
| alias gc='git commit' >> $1 | |
| alias gco='git checkout' >> $1 | |
| alias gl='git pull' >> $1 | |
| alias gpom="git pull origin master" >> $1 | |
| alias gp='git push' >> $1 | |
| alias gd='git diff | mate' >> $1 | |
| alias gb='git branch' >> $1 | |
| alias gba='git branch -a' >> $1 | |
| alias del='git branch -d' >> $1 | |
| alias gfu='git fetch origin --prune' >> $1 | |
| else | |
| echo 'NÃO FOI PASSADO NENHUM PARÂMETRO. :(' | |
| fi | |
| } | |
| if [[ $SHELL == "/bin/zsh" ]] | |
| then | |
| ZSH_FILE_PATH=~/.zshrc | |
| # install oh-my-zsh | |
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
| # install homebrew (aqui posso verificar o ambiente, se for MAC OS) | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| # install zsh-autosuggestions | |
| verify_git | |
| if [ $? -eq 0 ] | |
| then | |
| git clone git://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions | |
| echo 'source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh' >> $ZSH_FILE_PATH | |
| add_alias_git $ZSH_FILE_PATH | |
| else | |
| echo 'POR FAVOR, INSTALE A ÚLTIMA VERSÃO DO GIT. :)'; | |
| fi | |
| fi |
Author
coelhoadler
commented
Aug 5, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment