gplan 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/gplan +14 -6
  2. metadata +1 -1
data/bin/gplan CHANGED
@@ -63,22 +63,30 @@ def print
63
63
  end
64
64
 
65
65
  def setup_repository
66
- conf_file =Dir.pwd+"/.gplan"
67
- if File.exists?(conf_file)
68
- File.open(conf_file, "r") do |f|
69
- #target should be repository/branch
70
- @target = f.each_line.first.chomp
66
+ if ARGV[0] # allow you to pass in a SHA or remote/branch to target against. This can be useful when generating release notes after a deployment
67
+ @target = ARGV[0]
68
+ else
69
+ conf_file =Dir.pwd+"/.gplan"
70
+ if File.exists?(conf_file)
71
+ File.open(conf_file, "r") do |f|
72
+ #target should be repository/branch
73
+ @target = f.each_line.first.chomp
74
+ end
71
75
  end
72
76
  end
73
77
  # Set the default branch if one is not set
74
78
  @target = "production/master" unless @target
75
79
  @repo = @target.split("/").first
80
+ begin
81
+ `git fetch #{@repo}`
82
+ rescue
83
+ puts "unable to fetch #{@repo}, checking git log anyways..."
84
+ end
76
85
  end
77
86
 
78
87
  # MAIN
79
88
 
80
89
  setup_repository
81
- `git fetch #{@repo}`
82
90
  list= `git log #{@target}..`
83
91
 
84
92
  pb_story_ids = list.scan(PB_STORY_REGEX).flatten.uniq
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gplan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: