Skip to content

chuhlomin/aliases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aliases

This repository contains a collection of useful shell aliases:

  • e – exporting environment variables from .env files
  • clone – clone Git repository into ~/Projects/<owner>/<repo> directory
  • new – create new Go project with gonew tool
  • pull – Git pull with stash & rebase

e

e is a small shell alias for exporting environment variables from .env files.

You can find more alternative solutions here: https://gist.github.com/mihow/9c7f559807069a03e302605691f8557

Usage example:

$ cat .env
KEY=VALUE

$ echo $KEY

$ e

$ echo $KEY
VALUE

Accepts one optional argument – filename:

e .env.prod

Installation:

Bash:

source e.sh
# to persist append content of e.sh to ~/.bash_profile

Fish:

source e.fish
# to persist copy e.fish to ~/.config/fish/functions/

clone

clone is a wrapper on top of the git clone command, it:

  1. parses the URL
  2. creates "owner" directory in ~/Projects/
  3. clones repository into ~/Projects/<owner>/<repo>

Works with both SSH and HTTPS URLs.

Usage example:

$ cd ~/ # run from anywhere
$ clone git@github.com:chuhlomin/terraform.git

Cloning into '/Users/username/Projects/chuhlomin/terraform'...

Installation:

chmod +x clone.sh
mv clone.sh /usr/local/bin/clone

new

new <template> <new go module> is an alias for gonew:

gonew github.com/chuhlomin/gonew/<template> github.com/<current_directory>/<new go module>

Usage example:

$ cd ~/Projects/username
$ new server project
gonew: initialized github.com/username/project in ./project

Installation:

chmod +x new.sh
mv new.sh /usr/local/bin/new

pull

pull is a wrapper on to git pull with stash & rebase.

About

Collection of aliases and scripts

Resources

License

Stars

Watchers

Forks

Languages