Skip to content

Commit

Permalink
Fix file writing again
Browse files Browse the repository at this point in the history
  • Loading branch information
Pikachu920 committed Feb 5, 2024
1 parent 13e45dd commit e0ce3bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class EnvironmentResource(TypedDict):
if extra_plugins_directory is not None:
environments_dir = skript_repo_path / "src" / "test" / "skript" / "environments"
for environment_file_path in environments_dir.glob("**/*.json"):
with open(environment_file_path, "w") as environment_file:
with open(environment_file_path, "r") as environment_file:
environment = json.load(environment_file)
if "resources" not in environment:
environment["resources"] = []
Expand All @@ -58,8 +58,7 @@ class EnvironmentResource(TypedDict):
source=str(plugin_path.absolute().resolve()),
target=f"plugins/{plugin_path.name}"
))

with open(environment_file_path, "r") as environment_file:
with open(environment_file_path, "w") as environment_file:
print(json.dumps(environment))
json.dump(environment, environment_file)
shutil.rmtree(custom_test_directory, ignore_errors=True)
Expand Down

0 comments on commit e0ce3bc

Please sign in to comment.