Create a scanner python module

This commit is contained in:
Zoe Roux 2023-03-11 19:05:11 +09:00
parent 02214a127c
commit 42adf023d9
5 changed files with 23 additions and 0 deletions

1
scanner/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__

View File

@ -0,0 +1,9 @@
from .scanner import scan
def main():
import os
path = os.environ.get("LIBRARY_PATH")
if not path:
print("Missing environment variable 'LIBRARY_PATH'.")
exit(2)
return scan(path)

View File

@ -0,0 +1,5 @@
#!/usr/bin/env python
import scanner
exit(scanner.main())

View File

@ -0,0 +1,7 @@
from pathlib import Path
def scan(path: str):
for item in Path(path).rglob("*"):
if not item.is_file():
continue
print(item)

View File

@ -8,5 +8,6 @@ pkgs.mkShell {
sdk_6_0 sdk_6_0
aspnetcore_6_0 aspnetcore_6_0
]) ])
python3
]; ];
} }