File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ osx_image: xcode7.3
33cache :
44 directories :
55 - Lib/vendor/bundle
6+ before_install :
7+ - brew install jq
68install :
79 - " (cd Lib && bundle install --path=vendor/bundle --binstubs=vendor/bin)"
810before_script :
Original file line number Diff line number Diff line change @@ -93,9 +93,19 @@ namespace :test do
9393 end
9494 end
9595
96+ def branch_name
97+ if ENV [ 'CI' ]
98+ pull_req = %[https://api.github.com/repos/#{ ENV [ 'TRAVIS_REPO_SLUG' ] } /pulls/#{ ENV [ 'TRAVIS_PULL_REQUEST' ] } ]
99+ auth_token = 'kishikawakatsumi:209558699492df7782fbe62dda1891d6a6ba010f'
100+ ( ENV [ 'TRAVIS_PULL_REQUEST' ] == 'false' ? ENV [ 'TRAVIS_BRANCH' ] : `curl -u #{ auth_token } -s #{ pull_req } | jq -r .head.ref` ) . strip
101+ else
102+ %x[git rev-parse --abbrev-ref HEAD]
103+ end
104+ end
105+
96106 task :carthage do
97- sh ' echo " github \"kishikawakatsumi/KeychainAccess\" \"${sha:-master}"\" > Cartfile'
98- sh ' carthage update --no-use-binaries'
107+ sh %[ echo ' github \" kishikawakatsumi/KeychainAccess\" \" #{ branch_name } \" ' > Cartfile]
108+ sh %[ carthage update --no-use-binaries]
99109 end
100110end
101111
You can’t perform that action at this time.
0 commit comments