fix exception when spoiler season is inactive

This commit is contained in:
ebbit1q 2021-04-30 00:32:43 +02:00
parent c24ab7574d
commit 4b25618657
3 changed files with 6 additions and 2 deletions

View File

@ -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: |

2
.gitignore vendored
View File

@ -85,6 +85,8 @@ celerybeat-schedule
# virtualenv
venv/
ENV/
bin/
pyvenv.cfg
# Spyder project settings
.spyderproject

View File

@ -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__":