Skip to content

Commit

Permalink
Check in write functions for write flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Aug 7, 2023
1 parent 681d2f2 commit 3749f0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions suite/auto-sync/Updater/ASUpdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def patch_main_header(self) -> list:
Patches the main header of the arch with the .inc files.
It returns a list of files it has patched into the main header.
"""
if not self.write:
return []
main_header = get_path("{CS_INCLUDE_DIR}").joinpath(f"{self.arch.lower()}.h")
# Just try every inc file
patched = []
Expand All @@ -88,6 +90,8 @@ def copy_files(self, path: Path, dest: Path) -> None:
If path is a directory it copies all files in it.
If it is a file, it only copies it.
"""
if not self.write:
return
if not dest.is_dir():
fail_exit(f"{dest} is not a directory.")

Expand Down

0 comments on commit 3749f0d

Please sign in to comment.