Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use logging for build scripts
  • Loading branch information
Archmonger committed Dec 2, 2024
commit 7377659e2c9f12b90a325720220c826163105d04
3 changes: 3 additions & 0 deletions src/build_scripts/copy_dir.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ruff: noqa: INP001
import logging
import shutil
import sys
from pathlib import Path
Expand All @@ -18,13 +19,15 @@ def copy_files(source: Path, destination: Path) -> None:

if __name__ == "__main__":
if len(sys.argv) != 3:
logging.error("Script used incorrectly!\nUsage: python copy_dir.py <source_dir> <destination>")
sys.exit(1)

root_dir = Path(__file__).parent.parent.parent
src = Path(root_dir / sys.argv[1])
dest = Path(root_dir / sys.argv[2])

if not src.exists():
logging.error("Source directory %s does not exist", src)
sys.exit(1)

copy_files(src, dest)