Skip to content

Commit f355fb9

Browse files
Use ruby instead jq to parse JSON to pick current branch
1 parent e5884bd commit f355fb9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ cache:
66
before_install:
77
- brew update
88
- brew outdated carthage || brew upgrade carthage
9-
- brew install jq
109
install:
1110
- "(cd Lib && bundle install --path=vendor/bundle --binstubs=vendor/bin)"
1211
before_script:

Lib/Rakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'xcjobs'
2+
require 'json'
23

34
def destinations(platform: 'iphonesimulator')
45
if platform == 'iphonesimulator'
@@ -71,7 +72,7 @@ namespace :build do
7172
if ENV['CI']
7273
pull_req = %[https://api.github.com/repos/#{ENV['TRAVIS_REPO_SLUG']}/pulls/#{ENV['TRAVIS_PULL_REQUEST']}]
7374
auth_token = 'kishikawakatsumi:209558699492df7782fbe62dda1891d6a6ba010f'
74-
(ENV['TRAVIS_PULL_REQUEST'] == 'false' ? ENV['TRAVIS_BRANCH'] : `curl -u #{auth_token} -s #{pull_req} | jq -r .head.ref`).strip
75+
(ENV['TRAVIS_PULL_REQUEST'] == 'false' ? ENV['TRAVIS_BRANCH'] : JSON.parse(`curl -u #{auth_token} -s #{pull_req}`)['head']['ref']).strip
7576
else
7677
%x[git rev-parse --abbrev-ref HEAD]
7778
end

0 commit comments

Comments
 (0)