Small CLI tool to extract repository URL from text (from clipboard by default)
MIT License
extract-repo-url
cargo install extract-repo-url
Outputs a repository URL extracted from clipboard text.
$ extract-repo-url # From clipboard by default
https://github.com/foo/bar
$ extract-repo-url 'Repository https://github.com/foo/bar is awesome' # Can receive text as 1st param
https://github.com/foo/bar
It can also detect
[email protected]:foo/bar.git
-> https://github.com/foo/bar
)https://foo.github.io/bar/tree/master/tests/data
-> https://github.com/foo/bar
)https://foo.github.io/bar/
-> https://github.com/foo/bar
)foo bar https://bitbucket.org/foo/bar
-> https://bitbucket.org/foo/bar
)foo bar https://gitlab.com/foo/bar
-> https://gitlab.com/foo/bar
)You can add more hosts with $EXTRACT_REPO_URL_SERVICE_HOSTS
environment variable.
export EXTRACT_REPO_URL_SERVICE_HOSTS="github.your-site.com, gitlab.your-site.com"
Please try --help
option to see more details.
With Git:
$ git clone `extract-repo-url`
With open
command (on macOS):
$ open `extract-repo-url`
On Linux, you need to install X11 library:
sudo apt-get install xorg-dev
How to run test:
$ RUST_TEST_THREADS=1 cargo test