Skip to content

Commit

Permalink
main: install pipgrip in livecheck mode if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Feb 6, 2021
1 parent b544947 commit 2d18a19
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,12 @@ def read_brew(*args)
version = Version.parse tag
url = stable.url.gsub stable.version, version

# Check if formula is originating from PyPi
pypi_url = PyPI.update_pypi_url(stable.url, version)
if pypi_url
# Substitute url
url = pypi_url
# Install pipgrip utility so resources from PyPi get updated too
brew 'install', 'pipgrip'
end

Expand Down Expand Up @@ -144,6 +147,15 @@ def read_brew(*args)
formula = info['formula']
version = info['version']['latest']

# Get stable software spec of the formula
stable = Formula[formula].stable

# Check if formula is originating from PyPi
if !Formula["pipgrip"].any_version_installed? && PyPI.update_pypi_url(stable.url, version)
# Install pipgrip utility so resources from PyPi get updated too
brew 'install', 'pipgrip'
end

begin
# Finally bump the formula
brew 'bump-formula-pr',
Expand Down

0 comments on commit 2d18a19

Please sign in to comment.