]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Damned hard-coded bash shell fixer for Go
authorSergey Matveev <stargrave@stargrave.org>
Sat, 16 Jan 2021 13:37:36 +0000 (16:37 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 16 Jan 2021 13:47:03 +0000 (16:47 +0300)
bin/bin/go-fix-bash [new file with mode: 0755]

diff --git a/bin/bin/go-fix-bash b/bin/bin/go-fix-bash
new file mode 100755 (executable)
index 0000000..5a10855
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+find . -name "*.bash" -exec perl -i -npe 's%^#!/usr/bin/env bash%#!/bin/sh%' {} \+
+find . -name "*.bash" -exec perl -i -npe 's%^#!/bin/bash%#!/bin/sh%' {} \+
+find . -name "*.bash" -exec perl -i -npe 's%^bash %sh %' {} \+
+perl -i -npe "s/ulimit/echo --/g" src/run.bash