Created
March 14, 2016 17:46
-
-
Save shifakhan/8fd07497630ad1836019 to your computer and use it in GitHub Desktop.
Script to create shortcuts / aliases in Rails project, or any other project using gem aka
This file contains 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 | |
echo 'Creating aliases' | |
if SOURCE="${BASH_SOURCE[0]}"; then | |
echo 'Install and setup aka gem' | |
echo `sudo gem install aka2` | |
echo `sudo aka init --dotfile $HOME/.bash_profile` | |
echo 'Setting up aliases' | |
# System | |
echo `aka g lsl='ls -Gp -halt'` | |
# Rails | |
echo `aka g rc='rails c'` | |
echo `aka g rs='rails s'` | |
# Git | |
echo `aka g gc='git checkout'` | |
echo `aka g gs='git status'` | |
echo `aka g latest_branches='for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r'` | |
# SSH | |
echo `aka g ssh-staging='ssh user@12.23.233.123'` | |
echo `aka g ssh-production='ssh user@12.23.233.123'` | |
fi | |
source $HOME/.bash_profile | |
echo `aka l` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run: source shortcuts.sh