2025-02-04 16:53:12 +00:00
|
|
|
import shutil
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
def indent(*args):
|
|
|
|
indent = shutil.which('gst-indent-1.0')
|
|
|
|
|
|
|
|
if not indent:
|
|
|
|
raise RuntimeError('''Did not find gst-indent-1.0, please install it before continuing.''')
|
|
|
|
|
|
|
|
version = subprocess.run([indent, '--version'], capture_output=True, text=True)
|
|
|
|
|
2025-02-04 21:38:36 +00:00
|
|
|
if 'gst-indent' not in version.stdout:
|
2025-02-04 16:53:12 +00:00
|
|
|
raise RuntimeError(f'''Did not find gst-indent-1.0, please install it before continuing.
|
|
|
|
(Found {indent}, but it doesn't seem to be gst-indent-1.0)''')
|
|
|
|
|
2025-02-04 21:38:36 +00:00
|
|
|
subprocess.check_call([indent] + list(args))
|