Created
December 18, 2009 16:50
-
-
Save smathy/259605 to your computer and use it in GitHub Desktop.
Scripts for opening browser to github or lighthouse from console
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
alias gh=~/bin/gh.sh | |
alias lh=~/bin/lh.pl |
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 | |
open `git config -l | sed -En 's/remote.origin.url=git(@|:\/\/)github.com(:|\/)(.+)\/(.+).git/https:\/\/github.com\/\3\/\4/p'` |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
( my $branch=`git branch | grep '*' | cut -d' ' -f2` ) =~ s/\s//g; | |
my %projects = ( | |
'AMCO-Online' => 38551, | |
'AMCO-World' => 38553, | |
'SEQ' => 38556, | |
'Tiendita' => 38555, | |
'Visor' => 38552, | |
'ops' => 40578, | |
); | |
my($repo) = `git config -l | grep remote.origin.url` =~ m{git\@github.com:amco/(.*).git}; | |
my $root_url = qq{https://amco.lighthouseapp.com/projects}; | |
if( defined($repo) and exists( $projects{$repo})) { | |
my $p = $projects{$repo}; | |
if( $branch =~ /([0-9]+)/ ) { | |
exec( qq{open $root_url/$p/tickets/$1} ); | |
} | |
else { | |
exec( qq{open $root_url/$p/tickets?q=state:open} ); | |
} | |
} | |
else { | |
print "\e[31;1mNot in a recognized git project.\e[0m\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment