Skip to content

Commit

Permalink
v0.5.6 - bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Apr 28, 2021
1 parent 0d6cdd0 commit 225d301
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## v0.5.6 (2021-04-27)

* I'm ashamed to need to release 7 versions in a single night...
* Bug fixes for opening/writing README file

## v0.5.5 (2021-04-27)

* Setup a testing environment via Docker to assist with end-to-end testing this github action locally
Expand Down
10 changes: 6 additions & 4 deletions homebrew_releaser/readme_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def update_readme(homebrew_tap):
formulas = format_formula_data(homebrew_tap)
new_table = generate_table(formulas)
old_table = retrieve_old_table(homebrew_tap)
readme_content = read_current_readme()
readme_content = read_current_readme(homebrew_tap)
replace_table_contents(readme_content, old_table, new_table, homebrew_tap)


Expand Down Expand Up @@ -103,11 +103,12 @@ def retrieve_old_table(homebrew_tap):
return old_table


def read_current_readme():
def read_current_readme(homebrew_tap):
"""Reads the current README content
"""
try:
with open('README.md', 'r') as readme:
# TODO: Allow opening of non-uppercased README file here
with open(os.path.join(homebrew_tap, 'README.md'), 'r') as readme:
file_content = readme.read()
return file_content
logging.debug(f'{readme} read successfully.')
Expand All @@ -120,7 +121,8 @@ def replace_table_contents(file_content, old_table, new_table, homebrew_tap):
project table string
"""
try:
with open('README.md', 'w') as readme:
# TODO: Allow opening of non-uppercased README file here
with open(os.path.join(homebrew_tap, 'README.md'), 'w') as readme:
readme.write(file_content.replace(old_table, new_table + '\n'))
logging.debug(f'{readme} written successfully.')
except Exception as error:
Expand Down
1 change: 1 addition & 0 deletions homebrew_releaser/releaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def commit_formula(homebrew_owner, homebrew_tap, formula_folder, repo_name, vers
2) Commit and push the updated formula file to the repo
"""
try:
# TODO: Split the moving/adding logic away from the committing logic
output = subprocess.check_output(
(
f'mv {repo_name}.rb {homebrew_tap}/{formula_folder}/{repo_name}.rb'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name='homebrew-releaser',
version='0.5.5',
version='0.5.6',
description='Release scripts, binaries, and executables directly to Homebrew via GitHub Actions.',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 225d301

Please sign in to comment.