From 238456bdfd68d24be26f0d4f483eb2dede3fb668 Mon Sep 17 00:00:00 2001 From: ezsh <ezsh.junk@gmail.com> Date: Tue, 22 Jan 2019 01:39:16 +0100 Subject: [PATCH] Fixes for twine js generation Do not put Twee tag into the file, ignore "art/assistantArt.js", workaround sed script problem with '//' in string literals --- devTools/makeTwineJSPassage.sh | 4 ++-- devTools/stripComments.sed | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/devTools/makeTwineJSPassage.sh b/devTools/makeTwineJSPassage.sh index fe27af53067..408018e4a15 100755 --- a/devTools/makeTwineJSPassage.sh +++ b/devTools/makeTwineJSPassage.sh @@ -6,8 +6,8 @@ # $1: root repo dir # $2: output file name collectJSForTwine() { - echo ":: TwineJS [script]" > "$2" - find . -name '*.js' -exec echo -e "\n/* {} */\n" \; -a -exec sed -nf "$1"/devTools/stripComments.sed {} \; >> "$2" + echo "" > "$2" + find . -path ./art/assistantArt.js -prune -o -name '*.js' -exec echo -e "\n/* {} */\n" \; -a -exec sed -nf "$1"/devTools/stripComments.sed {} \; >> "$2" } ROOT_REPO_DIR="$(git rev-parse --show-toplevel)" diff --git a/devTools/stripComments.sed b/devTools/stripComments.sed index c9ceb3dc0c3..a289e43b1de 100755 --- a/devTools/stripComments.sed +++ b/devTools/stripComments.sed @@ -13,8 +13,9 @@ :loop +# ezsh: commented out because it removes '//' and everything after that in string literals # This line is sufficient to remove C++ comments! -/^\/\// s,.*,, +#/^\/\// s,.*,, /^$/{ x -- GitLab