Skip to content

Instantly share code, notes, and snippets.

@hazeledmands
Created February 3, 2015 19:32
Show Gist options
  • Save hazeledmands/675e6690dabd386aef1a to your computer and use it in GitHub Desktop.
Save hazeledmands/675e6690dabd386aef1a to your computer and use it in GitHub Desktop.
pivotal = require 'pivotal'
fibrous = require 'fibrous'
shelljs = require 'shelljs'
slug = require 'slug'
humanparser = require 'humanparser'
token = # ????
projectId = # ???
name = # ???
pivotal.useToken token
start = fibrous (storyId) ->
human = humanparser.parseName(name)
story = pivotal.sync.getStory projectId, storyId
slug = "#{human.firstName}/#{slug(story.name.slice(0, 40))}-#{storyId}".toLowerCase()
shelljs.exec "git checkout -b #{slug}"
# mark story as started
# story.current_state = 'started'
# pivotal.sync.updateStory projectId, story
start '79156070', (err) ->
if err
console.error "ERROR"
console.error err.stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment