Skip to content

Utils Aliases Functions helps you to replace manual tasks for functions in bash terminal globally.

Notifications You must be signed in to change notification settings

GabrielAlonsoCabral/utils-aliases-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Utils Aliases Functions

Utils Aliases Functions helps you to replace manual tasks for functions in bash terminal globally.
If you wish to use Javascript or another programming language instead the common SH Functions this is the correct repository.

Developed by: @GabrielAlonsoCabral

Installation

# clone this repository
$ git clone https://github.com/GabrielAlonsoCabral/utils-aliases-functions.git .aliases
$ cd .aliases

Configure Your Environment

AWS Credentials

  1. Inside .credentials/ Replace your aws.credentials.example.json by aws.credentials.json
  2. Replace profiles in JSON by your aws profiles

MacOS

Add this code lines on your ~/.zshrc

export ALIASES_PATH="$HOME/.aliases"
export AWS_PATH="$HOME/.aws"        
export GH_NAME="ADD_YOUR_GITHUB_NAME"

function toggleAwsProfile {
    currentPath=$PWD;
    cd $ALIASES_PATH;
    node $ALIASES_PATH/functions/toggle-aws-profile.js;
    cd $currentPath;
}

function showAwsProfile {
    currentPath=$PWD;
    cd $ALIASES_PATH;
    node $ALIASES_PATH/functions/show-aws-profile.js;
    cd $currentPath;
}  

function commit (){
  /usr/bin/python $ALIASES_PATH/functions/commit.py "$@"
}

function pull (){
  /usr/bin/python $ALIASES_PATH/functions/pull.py "$@"
}

function push (){
  /usr/bin/python $ALIASES_PATH/functions/push.py "$@"
}

function branch (){
  /usr/bin/python $ALIASES_PATH/functions/branch.py "$@"
}

function portkill (){
  sh $ALIASES_PATH/functions/portkill.sh "$@"
}

Enable Changes

$ source ~/.zshrc

Linux

Add this code lines on your ~/.bashrc

export ALIASES_PATH="$HOME/.aliases"
export AWS_PATH="$HOME/.aws"    
export GH_NAME="ADD_YOUR_GITHUB_NAME"

function toggleAwsProfile {
    currentPath=$PWD;
    cd $ALIASES_PATH;
    node $ALIASES_PATH/functions/toggle-aws-profile.js;
    cd $currentPath;
}

function showAwsProfile {
    currentPath=$PWD;
    cd $ALIASES_PATH;
    node $ALIASES_PATH/functions/show-aws-profile.js;
    cd $currentPath;
}

function commit (){
  python3 $ALIASES_PATH/functions/commit.py "$@"
}

function pull (){
  python3 $ALIASES_PATH/functions/pull.py "$@"
}

function push (){
  python3 $ALIASES_PATH/functions/push.py "$@"
}

function branch (){
  python3 $ALIASES_PATH/functions/branch.py "$@"
}

function portkill (){
  sh $ALIASES_PATH/functions/portkill.sh "$@"
}

Enable Changes

$ source ~/.bashrc

Usage

# Show your default AWS Profile 
$ showAwsProfile

# Toggle your default AWS Profile 
$ toggleAwsProfile

# Create a git branch with name pattern (ex: "GabrielAlonsoCabral/TITLE")
$ branch --name "TITLE"

# Push your current branch to remote origin
$ push

# pull your current branch with master
$ pull

# Add your changed files and commit it with pattern name
$ commit

# Add your changed files and commit it with pattern name and open pull request
$ commit --pr

# Kill process running in PORT 3000
$ portkill 3000

About

Utils Aliases Functions helps you to replace manual tasks for functions in bash terminal globally.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published