From 3982a8b31c496f1b575a7813250b5475a3b35a13 Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Sat, 6 Nov 2021 20:24:17 +0800 Subject: [PATCH] fix possible nested comment --- scripts/generate_header.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/generate_header.sh b/scripts/generate_header.sh index 469d4dbf..c4789e15 100755 --- a/scripts/generate_header.sh +++ b/scripts/generate_header.sh @@ -66,6 +66,9 @@ decl_export() { uncomment $1 | onelineize | export_sym } +print_self() { + cat "$0" | sed -e 's#^#// #' +} generate_header() { local LUA_PATH="$1" @@ -83,10 +86,10 @@ generate_header() { echo "In linux, to compile this file, you'd do: 'gcc -o xxxxx.so -shared xxxxx.c'. Simple!" echo "Due to the way the API is structured, you *should not* link or include lua libraries." echo "This file was automatically generated by the below code. DO NOT MODIFY DIRECTLY." - echo - echo - cat "$0" echo "**/" + echo + print_self + echo echo "#include " decl "$LUA_PATH/lua.h" @@ -112,7 +115,10 @@ generate_api_require() { echo "returns a function pointer with it's corresponding name." echo echo "This file is automatically generated. DO NOT MODIFY." - echo "*/" + echo "**/" + echo + print_self + echo echo "#include " echo "#include " echo '#include "lua.h"'