mirror of
https://github.com/open-goal/jak-project.git
synced 2024-11-24 06:39:51 +00:00
2436a8a541
* Use env shebangs * CMake cleanup, install() invocations, & CTest `ctest` & the `test` target work now * Nixpkgs support
22 lines
498 B
Python
22 lines
498 B
Python
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
import os
|
|
from glob import glob
|
|
|
|
|
|
folders = sys.argv
|
|
cwd = os.getcwd()
|
|
|
|
for folder in folders:
|
|
directory = os.path.join(cwd, folder)
|
|
files = [y for x in os.walk(directory) for y in glob(os.path.join(x[0], '*.h'))]
|
|
for fPath in files:
|
|
print("Processing %s" % fPath)
|
|
with open(fPath, 'r+') as f:
|
|
content = f.read()
|
|
f.seek(0, 0)
|
|
if (content.startswith("#pragma once") == False):
|
|
f.write("#pragma once\n\n" + content)
|
|
|