summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-05-09 10:32:20 +0000
committerLibravatar tobi <kipvandenbos@noreply.codeberg.org>2025-05-09 10:32:20 +0000
commitcfa83fb44c4888f7ef3983f78b750fddc1ee768e (patch)
treeec1337c445603bc6fd87ac47220622fc1e4d349c /scripts
parent[feature] Add extra opengraph meta tags (#4154) (diff)
downloadgotosocial-cfa83fb44c4888f7ef3983f78b750fddc1ee768e.tar.xz
[chore] include a monstrous all_licenses.txt in our web assets (#4155)
Should fix https://codeberg.org/superseriousbusiness/gotosocial/issues/4153 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4155 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bundle_licenses.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/bundle_licenses.sh b/scripts/bundle_licenses.sh
new file mode 100755
index 000000000..a883a0d8f
--- /dev/null
+++ b/scripts/bundle_licenses.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+set -ex
+
+# Split on
+# new line
+IFS='
+'
+
+license_filter() { grep -iE '.*/license(\.\w+)?$'; }
+
+OUTPUT='./web/assets/all_licenses.txt'
+echo '' > "$OUTPUT" # reset output
+
+# Copy over any licenses in our golang dependencies
+for file in $(find ./vendor | license_filter); do
+ echo "${file}:" >> "$OUTPUT"
+ cat "$file" >> "$OUTPUT"
+ echo >> "$OUTPUT"
+done
+
+# Copy over any licenses in our javacsript dependencies
+for file in $(find ./web/source | license_filter); do
+ echo "${file}:" >> "$OUTPUT"
+ cat "$file" >> "$OUTPUT"
+ echo >> "$OUTPUT"
+done
+
+# Copy over misc other licenses
+for file in ./LICENSE \
+ ./web/source/nollamasworker/sha256.js; do
+ echo "${file}:" >> "$OUTPUT"
+ cat "$file" >> "$OUTPUT"
+ echo >> "$OUTPUT"
+done