Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update homebrew version for CocoaPods #60

Open
orta opened this issue Apr 22, 2016 · 0 comments
Open

Update homebrew version for CocoaPods #60

orta opened this issue Apr 22, 2016 · 0 comments

Comments

@orta
Copy link
Member

orta commented Apr 22, 2016

Homebrew/homebrew-core#507
CocoaPods/CocoaPods#2238 (comment)

We do this already in the CP mac app:

    FileUtils.remove_dir("homebrew_cask") if Dir.exists? "homebrew_cask"
    sh "git clone https://github.com/caskroom/homebrew-cask.git homebrew_cask"
    Dir.chdir('homebrew_cask') do
      sh "git pull origin master"
      sh "git remote add fork https://github.com/#{cask_fork}.git"
      sh "git checkout -b #{branch}"

      cask_file = 'Casks/cocoapods.rb'
      cask = File.read(cask_file)
      cask.sub! /version '#{Gem::Version::VERSION_PATTERN}'/, "version '#{version}'"
      cask.sub! /sha256 '[[:xdigit:]]+'/, "sha256 '#{sha(tarball)}'"
      appcast_url = cask.match(/appcast '(.*)'/)[1]
      sparkle_checkpoint = %x{ cat ../gh-pages/sparkle.xml | sed 's|<pubDate>[^<]*</pubDate>||g' | shasum --algorithm 256 | awk '{ print $1 }'}.strip
      cask.sub! /checkpoint: '[[:xdigit:]]+'/, "checkpoint: '#{sparkle_checkpoint}'"
      File.open(cask_file, 'w') { |f| f.write(cask) }

      sh "git commit -am '#{message}'"
      sh "git push fork"
    end

    REST.post("https://api.github.com/repos/caskroom/homebrew-cask/pulls?access_token=#{github_access_token}",
              {title: message, head: cask_fork.split('/').first + ":#{branch}", base: 'master'}.to_json,
              github_headers)
  end
end

We can probably make a variation that does it for the main gems pretty simply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant