From 4b25618657c8ecfd569ed449da503d84f4ae3ef5 Mon Sep 17 00:00:00 2001 From: ebbit1q Date: Fri, 30 Apr 2021 00:32:43 +0200 Subject: [PATCH] fix exception when spoiler season is inactive --- .github/workflows/deploy.yml | 2 +- .gitignore | 2 ++ magic_spoiler/__main__.py | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 414f3861..8b9387d9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -53,7 +53,7 @@ jobs: run: python3 -m magic_spoiler - name: Deploy changes - if: env.DEPLOY == 'true' && steps.run.outputs.deploy != null + if: env.DEPLOY == 'true' && steps.run.outputs.deploy == 'true' shell: bash working-directory: ${{env.OUTPUT_PATH}} run: | diff --git a/.gitignore b/.gitignore index 275349cb..aacabd7c 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,8 @@ celerybeat-schedule # virtualenv venv/ ENV/ +bin/ +pyvenv.cfg # Spyder project settings .spyderproject diff --git a/magic_spoiler/__main__.py b/magic_spoiler/__main__.py index 1c0c799a..45fc6386 100644 --- a/magic_spoiler/__main__.py +++ b/magic_spoiler/__main__.py @@ -602,7 +602,7 @@ def delete_old_files() -> bool: shutil.rmtree(OUTPUT_TMP_DIR) if not SPOILER_SETS.get(): - OUTPUT_DIR.joinpath("SpoilerSeasonEnabled").unlink() + OUTPUT_DIR.joinpath("SpoilerSeasonEnabled").unlink(missing_ok=True) else: OUTPUT_DIR.joinpath("SpoilerSeasonEnabled").open("w").write(" ") @@ -643,6 +643,8 @@ def main() -> None: # Set output to deploy if changed: print("::set-output name=deploy::true") + else: + print("::set-output name=deploy::false") if __name__ == "__main__":