Skip to content

Commit 7377659

Browse files
committed
Use logging for build scripts
1 parent 18ea7ff commit 7377659

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/build_scripts/copy_dir.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# ruff: noqa: INP001
2+
import logging
23
import shutil
34
import sys
45
from pathlib import Path
@@ -18,13 +19,15 @@ def copy_files(source: Path, destination: Path) -> None:
1819

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

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

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

3033
copy_files(src, dest)

0 commit comments

Comments
 (0)