[meld] Add missed shebang-stripping script
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Add missed shebang-stripping script
- Date: Thu, 11 Aug 2022 21:16:52 +0000 (UTC)
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]