Last active
November 19, 2017 06:26
-
-
Save masiuchi/347b5474b091af2115a36a09fbf2bff0 to your computer and use it in GitHub Desktop.
Open GitHub, Travis CI and CircleCI of current repository.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
github() { | |
git remote get-url origin \ | |
| perl -pe 'if (s|^git@||) { s|\.git$||; s|:|/|; s|^(.)|https://$1| }' \ | |
| xargs open | |
} | |
travis() { | |
git remote get-url origin \ | |
| perl -pe 's|^git\@github\.com:||; s|\.git$||; s|^(.)|https://travis-ci.org/$1|' \ | |
| xargs open | |
} | |
circleci() { | |
git remote get-url origin \ | |
| perl -pe 's|^git\@github\.com:||; s|\.git$||; s|^(.)|https://circleci\.com/gh/$1|' \ | |
| xargs open | |
} | |
SUBCOMMAND=$1 | |
if [ "$SUBCOMMAND" = "travis" ]; then | |
travis | |
elif [ "$SUBCOMMAND" = "circleci" ]; then | |
circleci | |
else | |
github | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment