@mrpotatoes/git-url
"outFile"
-> https://stackoverflow.com/questions/34474651/typescript-compile-to-single-file
An easy way to open a git url to either to the pull request, commits, branches, browse pages using one command.
Just goto to any directory git
managed directory (a directory with .git
somewhere in it's parents) and run git-url
.
Options
none -> open just the browse page
--pr -> open the pull-requests page
--commits -> open the commits page
--branches -> open the branches page
--browse -> open the browse page
Only opens the main page if no flags are provided.
If you add any in combination you'll open all of them in their own links.
Currently only works in mac. Quick fix for all coming.
The way it works
Only cares about the host and path segments. Anything else should be ignored.
- Go-to a git managed directory
- Run
git-url
and flags into command prompt- Strips the
--
for each flag.
- Strips the
- Load all external plugins from user directory (
~/.git-url.external.js
) - Get the remote repo git url
- Determine which provider (github, bitbucket et al)
- Build new base URL
- Run the provider function and build paths for any/all flags
- Open the URLs
TODO
- Read configs from YML
- Lens perhaps?!?!?!
- Use a state monad to transfer state between functions
- Generalize the provider functions so that I don't have to keep writing the same code
- Like, dude, actually write the tests
- Convert to use
babel
so that I can do exports - Use
babel
to build a single JS file for use external to this machine (aka publishing). - IO Monads:
- State Monad