[meld] Add missed shebang-stripping script



commit 1a8c44ea48f2e6cbdc11c47f0c5754c47c343a0d
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Fri Aug 12 07:16:29 2022 +1000

    Add missed shebang-stripping script

 meson_shebang_normalisation.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/meson_shebang_normalisation.py b/meson_shebang_normalisation.py
new file mode 100755
index 00000000..4cf18754
--- /dev/null
+++ b/meson_shebang_normalisation.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+
+import pathlib
+import sys
+
+
+def main():
+    in_path = pathlib.Path(sys.argv[1])
+    out_path = pathlib.Path(sys.argv[2])
+    if not in_path.exists():
+        print(f"Couldn't find {in_path}")
+        sys.exit(1)
+
+    lines = in_path.read_text().splitlines(keepends=True)
+    lines[0] = "".join(lines[0].split("env "))
+    out_path.write_text("".join(lines))
+
+
+if __name__ == "__main__":
+    main()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]