mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
b5dae423cb
This is python based and is now functional for windows. We now should be able to extend this script for linux and mac. Move setup script to Tools folder.
21 lines
614 B
Python
21 lines
614 B
Python
import fnmatch
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
|
|
executable = "cmake-format"
|
|
if os.name == 'nt':
|
|
executable += ".exe"
|
|
|
|
for root, dirnames, filenames in os.walk('../'):
|
|
for filename in fnmatch.filter(filenames, 'CMakeLists.txt'):
|
|
print(executable, root+"/"+filename)
|
|
os.system(" %s -c ../.cmake-format.py -i %s" % (executable, (root + "/" + filename)))
|
|
|
|
# Check if all files are formatter
|
|
output = subprocess.check_output("git diff", shell=True)
|
|
|
|
if output:
|
|
print("Git diff is not empty. This means your CMakeLists.txt file was not formatted via %s!" % executable)
|
|
sys.exit(1)
|