Crates.io | hacknow |
lib.rs | hacknow |
version | 0.1.0 |
source | src |
created_at | 2017-09-25 20:00:59.212627 |
updated_at | 2017-09-25 20:00:59.212627 |
description | A utility for automation of project directories and switching workspaces |
homepage | |
repository | https://github.com/NeoLegends/hacknow-rs |
max_upload_size | |
id | 33101 |
size | 7,135 |
Utility for automation of project directories and switching workspaces based on the GitHub directory structure - User/Project
This is a RIIR for fun of mraerino/hacknow.
<projects-dir>/<user>/<repo>
git fetch --all
for this repoThis is available on cargo:
`cargo install hacknow``
If you want your shell to switch into the project directory, you need to create a small function inside your shell config (.bashrc
, .zshrc
or similar)
hn() {
PROJECTPATH=$(hacknow "$@")
RETVAL=$?
cd $PROJECTPATH
return $RETVAL
}
Choose a different alias if hn
doesn't work for you.
Please note: On failure hacknow will echo just .
to stdout, so it should be safe to call cd
on it in every situation.
hacknow <user>/<repo> # Plain (without dir change)
hn <user>/<repo> # Needs a shell function (see above)
cd $(hacknow <user>/<repo>) # Alternative if the shell function does not work for you
-d|--dir <dir> Choose base directory for your projects (default: $HOME)
--ssh Use ssh protocol for git remote
$ hn mraerino/gitmoji
$ hn mraerino/hacknow -d ~/src
$ hn festify/app --ssh
nvm
, virtualenv
, yarn install
, IDE launch...)