Skip to content

Instantly share code, notes, and snippets.

@coelhoadler
Last active August 5, 2018 11:38
Show Gist options
  • Select an option

  • Save coelhoadler/a412941d84285805b20cb3ba531c3921 to your computer and use it in GitHub Desktop.

Select an option

Save coelhoadler/a412941d84285805b20cb3ba531c3921 to your computer and use it in GitHub Desktop.
[WIP] Starting a .sh file to automate my developer environment.
#!/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
@coelhoadler
Copy link
Author

My favorite oh-my-zsh theme = "spaceship"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment