Last active
December 16, 2015 13:19
-
-
Save tmiller/5440617 to your computer and use it in GitHub Desktop.
Pivotal tracker CLI example
This file contains 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
package main | |
import ( | |
"fmt" | |
"github.com/tmiller/pt" | |
"os/exec" | |
) | |
func main() { | |
pivotalTracker := pt.PivotalTracker{"API Key"} | |
gitBranchCommand := exec.Command("git", "symbolic-ref", "--short", "HEAD") | |
storyId, err := gitBranchCommand.Output() | |
if err != nil { | |
return | |
} | |
if story, ok := pivotalTracker.FindStory(storyId); ok { | |
fmt.Printf("[#%d] \n\n%s\n%s\n", story.Id, story.Name, story.Url) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment