Skip to content

Instantly share code, notes, and snippets.

@tmiller
Last active December 16, 2015 13:19
Show Gist options
  • Save tmiller/5440617 to your computer and use it in GitHub Desktop.
Save tmiller/5440617 to your computer and use it in GitHub Desktop.
Pivotal tracker CLI example
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