From f0bd320683b35cfc05b7586a4c4c118dcdd4eb75 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Sat, 16 May 2020 17:04:46 +0200 Subject: [PATCH] Make the unit.js.tpl actually work with the new path of the files, remove silly printf hack for indentation by allowing only one indentation at a time and make sure empty lines don't get indented --- unit.js.tpl | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/unit.js.tpl b/unit.js.tpl index ebbc7c8..418033d 100755 --- a/unit.js.tpl +++ b/unit.js.tpl @@ -2,15 +2,36 @@ indent() { - local tabs="$(printf '\t%.0s' `seq 1 $1`)" - sed "s|^|${tabs}|" + sed "s|^\(.\)|\t\1|" +} + +moduleName() +{ + local fileName="${1##*/}" + printf "${fileName%.*}" +} + +MODULES="" +for file in "${@}" +do + MODULES="${MODULES}:$(moduleName "${file}")" +done +MODULES="${MODULES#:}" + +includeModule() +{ +cat <