Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
branch_name = `git rev-parse --abbrev-ref HEAD`
branch_number_regex = /^(\d+)/
matcher = branch_name.match(branch_number_regex)
branch_number = matcher[1] if matcher
if branch_number
path = ARGV[0]