diff --git a/CHANGELOG.md b/CHANGELOG.md index c35e77f..d717b76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/homebrew_releaser/readme_updater.py b/homebrew_releaser/readme_updater.py index 7012c66..f522859 100644 --- a/homebrew_releaser/readme_updater.py +++ b/homebrew_releaser/readme_updater.py @@ -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) @@ -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.') @@ -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: diff --git a/homebrew_releaser/releaser.py b/homebrew_releaser/releaser.py index ca75777..08c656e 100644 --- a/homebrew_releaser/releaser.py +++ b/homebrew_releaser/releaser.py @@ -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' diff --git a/setup.py b/setup.py index 251a229..8629782 100644 --- a/setup.py +++ b/setup.py @@ -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",