mirror of
https://github.com/chatmail/core.git
synced 2026-05-17 05:46:30 +03:00
Make it easier to run src/top_evil_rs.py from git root
Currently, `src/top_evil_rs.py' script recursively scans current directory for Rust sources and print statistics about them. When run from git root, it also scans target/ directory, which is useless. This commit add cludge that checks if script is run from git root directory, and `chdir' into `src/' before performing actions. Unprincipled, but convenient.
This commit is contained in:
@@ -6,6 +6,8 @@ import os
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
if Path('src/top_evil_rs.py').exists():
|
||||||
|
os.chdir('src')
|
||||||
filestats = []
|
filestats = []
|
||||||
for fn in Path(".").glob("**/*.rs"):
|
for fn in Path(".").glob("**/*.rs"):
|
||||||
s = fn.read_text()
|
s = fn.read_text()
|
||||||
|
|||||||
Reference in New Issue
Block a user