Created
March 27, 2015 21:03
-
-
Save aharpole/d6a6f95b3704014f5838 to your computer and use it in GitHub Desktop.
a Greasemonkey script for Tower users to Open in Tower using SSH instead of HTTPS
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
| // ==UserScript== | |
| // @name GitHub open in desktop ssh | |
| // @namespace 1427488342954 | |
| // @version 0.1 | |
| // @updateURL | |
| // @downloadURL | |
| // @include https://github.com/* | |
| // ==/UserScript== | |
| $(document).ready(function() { | |
| $('a.sidebar-button').each(function() { | |
| var re = /^github-mac/; | |
| if($(this).attr('href').match(re)) { | |
| var pieces = $(this).attr('href').split('/'); | |
| var newHref = "github-mac://openRepo/git@github.com:" + pieces[pieces.length - 2] + "/" + pieces[pieces.length - 1]; | |
| $(this).attr('href',newHref) | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment