alpha_omega 0.0.125 → 0.0.126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.125
1
+ 0.0.126
@@ -141,9 +141,9 @@ module AlphaOmega
141
141
  end
142
142
 
143
143
  def self.what_branch (allowed = %w(production staging master develop) + [%r(/)])
144
- current = `git branch`.split("\n").find {|b| b.split(" ")[0] == '*' } # use Grit
145
- if current
146
- star, branch_name = current.split(" ")
144
+ current = `cat .git/HEAD`.strip
145
+ if current[0] == "ref:"
146
+ branch_name = current[1].split("/")[2..-1].join("/")
147
147
  if allowed.any? {|rx| rx.match(branch_name) }
148
148
  branch_name
149
149
  else
@@ -151,8 +151,7 @@ module AlphaOmega
151
151
  abort
152
152
  end
153
153
  else
154
- puts "could not find a suitable branch"
155
- abort
154
+ current[0]
156
155
  end
157
156
  end
158
157
 
data/libexec/proxy CHANGED
@@ -4,11 +4,15 @@ hst_proxy="${GATEWAY:=deploy}"
4
4
 
5
5
  # remote arguments
6
6
  git_url="$(git config --list | grep remote.origin.url | cut -d= -f2-)"
7
- git_branch="$(git branch | grep '^\*' | awk '{print $2}' | head -1)"
8
- if [[ $git_branch = "(no" ]]; then
7
+
8
+ git_ref=$(cat .git/HEAD)
9
+ if echo "$git_ref" | egrep -q "^ref:"; then
10
+ git_branch=$(echo "$git_ref" | awk '{print $1}' | cut -d/ -f3-)
11
+ git_head=$(git show-ref --hash "$(echo "$git_ref" | awk '{print $2}')")
12
+ else
9
13
  git_branch=""
14
+ git_head=$git_ref
10
15
  fi
11
- git_head="$(git show-ref --head HEAD | awk '$2 == "HEAD" {print $1}')"
12
16
 
13
17
  if [[ -z $git_head ]]; then
14
18
  echo "ERROR: could not find the SHA for HEAD" 1>&2
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alpha_omega
3
3
  version: !ruby/object:Gem::Version
4
- hash: 229
4
+ hash: 227
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 125
10
- version: 0.0.125
9
+ - 126
10
+ version: 0.0.126
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Nghiem