From 48c20b6c305cf7ec145062896c1cd961afb38c8a Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Thu, 9 Nov 2023 11:55:26 +0100 Subject: [PATCH] './make build js' now adds SPDX header to generated javascript --- make | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/make b/make index e390168..1763776 100755 --- a/make +++ b/make @@ -59,14 +59,19 @@ build(){ ok=$? sed -i 's|.*nonlocal .*||g' dist/xrfragment.py ls -lah dist/* + exit echo -e "[OK] parser build\n" } js(){ - # prepend license to vanilla lib - #echo "// https://xrfragment.org\n// SPDX-License-Identifier: MPL-2.0\n$(cat dist/xrfragment.js)" > dist/xrfragment.js + license_js="/*" + license_js="${license_js}\n * generated at $(date)" + license_js="${license_js}\n * https://xrfragment.org" + license_js="${license_js}\n * SPDX-License-Identifier: MPL-2.0" + license_js="${license_js}\n */\n" + # add js module - cat dist/xrfragment.js > dist/xrfragment.module.js + cat dist/xrfragment.js >> dist/xrfragment.module.js echo "export default xrfragment;" >> dist/xrfragment.module.js # add THREE cat dist/xrfragment.js \ @@ -85,6 +90,8 @@ build(){ src/3rd/js/aframe/*.js > dist/xrfragment.aframe.js # convert ESM to normal browser js sed 's/export //g' example/assets/js/utils.js > dist/utils.js + # add license headers + for i in dist/*.js; do echo -e "${license_js}$(cat $i)" > $i; done ls -la dist | grep js exit $ok }