MSR: Restructure code
#!/bin/bash
-INFILE="$1"
@INCLUDE_COMMON@
-BLOCKS=$(sed -n '/```sh/,/```\n/p' "$1")
-BUF=
-SHELL_RECORDER_ERROR=0
+# -- Functions -----------------------------------------------------------------------------------------------------------------------------
resetGlobals()
{
@@ -106,8 +103,14 @@ translate()
rm "$TMPFILE"
}
+# -- Main ----------------------------------------------------------------------------------------------------------------------------------
+
resetGlobals
+INFILE="$1"
+BLOCKS=$(sed -n '/```sh/,/```\n/p' "$1")
+BUF=
+SHELL_RECORDER_ERROR=0
INBLOCK=0
IFS=''
