mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-01 06:28:21 +00:00
21 lines
474 B
Python
21 lines
474 B
Python
|
#!/usr/bin/env python.com
|
||
|
|
||
|
import os
|
||
|
import sys
|
||
|
|
||
|
def CheckFile(path):
|
||
|
if path.endswith(('.png', '.ico')):
|
||
|
return
|
||
|
sys.stderr.write('%s\n' % (path))
|
||
|
with open(path) as f:
|
||
|
data = f.read()
|
||
|
assert '#include' not in data[65530:], "late include in %s" % (path)
|
||
|
|
||
|
for arg in sys.argv[1:]:
|
||
|
if os.path.isdir(arg):
|
||
|
for dirpath, dirs, files in os.walk(arg):
|
||
|
for filepath in files:
|
||
|
CheckFile(os.path.join(dirpath, filepath))
|
||
|
else:
|
||
|
CheckFile(arg)
|