mirror of
https://github.com/daylinmorgan/monolisa-nerdfont-patch.git
synced 2024-12-22 15:00:45 -06:00
29 lines
584 B
Text
29 lines
584 B
Text
|
#!/usr/bin/env python3
|
||
|
|
||
|
import sys
|
||
|
from pathlib import Path
|
||
|
|
||
|
|
||
|
def find_files(search_path, exts=None):
|
||
|
return (
|
||
|
[f for ext in exts for f in search_path.glob(f"**/*.{ext}")]
|
||
|
if exts
|
||
|
else [f for f in search_path.rglob("*") if f.is_file()]
|
||
|
)
|
||
|
|
||
|
|
||
|
def main():
|
||
|
if len(sys.argv) == 1:
|
||
|
print("please specify directory to search")
|
||
|
exit(1)
|
||
|
|
||
|
search_path = Path(sys.argv[1])
|
||
|
exts = sys.argv[2].split(",") if len(sys.argv) == 3 else None
|
||
|
|
||
|
for f in find_files(search_path, exts):
|
||
|
print(f)
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|