Skip to content

Commit

Permalink
main: only pass --version in livecheck mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Jul 25, 2020
1 parent f5ca97a commit ba8ce67
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,28 +153,15 @@ def read_git(*args)

# Get info about formula
formula = info['formula']
stable = Formula[formula].stable
is_git = stable.downloader.is_a? GitDownloadStrategy

# Prepare tag and revision or url
if is_git
dir = "/tmp/#{formula}"
tag = stable.specs[:tag].gsub stable.version, info['version']['latest']
git 'clone', '--depth', '1', '--branch', tag, stable.url, dir
revision = read_git '-C', dir, 'rev-parse', 'HEAD'
else
url = stable.url.gsub stable.version, info['version']['latest']
end
version = info['version']['latest']

begin
# Finally bump the formula
brew 'bump-formula-pr',
'--no-audit',
'--no-browse',
"--message=#{message}",
*("--url=#{url}" unless is_git),
*("--tag=#{tag}" if is_git),
*("--revision=#{revision}" if is_git),
"--version=#{version}",
*('--force' unless force.false?),
formula
rescue ErrorDuringExecution => e
Expand Down

0 comments on commit ba8ce67

Please sign in to comment.