Skip to content

Commit

Permalink
fix: use glob for gemspec path calculation in dependent-rake
Browse files Browse the repository at this point in the history
  • Loading branch information
CAMOBAP committed Dec 1, 2024
1 parent 9111c03 commit 121f5cc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/dependent-rake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ jobs:
with:
submodules: true

# - run: ruby -e 'puts Gem::Specification.load(Dir.glob("*.gemspec").first)&.name' >>

- uses: actions/checkout@v4
with:
submodules: recursive
Expand All @@ -65,15 +63,16 @@ jobs:
shell: python
run: |
import fileinput
import glob
import sys
import os
gem_name = '${{ github.event.repository.name }}'
dependent_gem_name = '${{ matrix.repo }}'.split('/')[-1]
with fileinput.FileInput(dependent_gem_name + '.gemspec', inplace=True) as file:
gemspec = glob.glob('*.gemspec')[0]
with fileinput.FileInput(gemspec, inplace=True) as file:
for line in file:
if gem_name not in line:
print(line, end='')
print("'{}' removed from {}.gemspec".format(gem_name, dependent_gem_name))
print("'{}' removed from {}".format(gem_name, gemspec))
if os.path.exists("Gemfile.lock"):
os.remove("Gemfile.lock")
print("Gemfile.lock dropped")
Expand Down

0 comments on commit 121f5cc

Please sign in to comment.