2025-05-09 10:32:20 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
|
|
# Split on
|
|
|
|
|
# new line
|
|
|
|
|
IFS='
|
|
|
|
|
'
|
|
|
|
|
|
|
|
|
|
license_filter() { grep -iE '.*/license(\.\w+)?$'; }
|
|
|
|
|
|
|
|
|
|
OUTPUT='./web/assets/all_licenses.txt'
|
2025-05-09 16:14:10 +00:00
|
|
|
echo 'The GoToSocial software uses the following dependencies, whose licenses are reproduced in full:' > "$OUTPUT" # reset output
|
|
|
|
|
echo >> "$OUTPUT"
|
2025-05-09 10:32:20 +00:00
|
|
|
|
|
|
|
|
# Copy over any licenses in our golang dependencies
|
|
|
|
|
for file in $(find ./vendor | license_filter); do
|
2025-05-09 16:14:10 +00:00
|
|
|
echo "----------------------------------------------------------" >> "$OUTPUT"
|
|
|
|
|
echo >> "$OUTPUT"
|
|
|
|
|
echo "${file}:" >> "$OUTPUT"
|
|
|
|
|
echo >> "$OUTPUT"
|
|
|
|
|
cat "${file}" >> "$OUTPUT"
|
|
|
|
|
echo >> "$OUTPUT"
|
2025-05-09 10:32:20 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Copy over any licenses in our javacsript dependencies
|
|
|
|
|
for file in $(find ./web/source | license_filter); do
|
2025-05-09 16:14:10 +00:00
|
|
|
echo "----------------------------------------------------------" >> "$OUTPUT"
|
|
|
|
|
echo >> "$OUTPUT"
|
|
|
|
|
echo "${file}:" >> "$OUTPUT"
|
|
|
|
|
echo >> "$OUTPUT"
|
|
|
|
|
cat "${file}" >> "$OUTPUT"
|
|
|
|
|
echo >> "$OUTPUT"
|
2025-05-09 10:32:20 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Copy over misc other licenses
|
2025-09-17 14:16:53 +02:00
|
|
|
for file in ./LICENSE; do
|
2025-05-09 16:14:10 +00:00
|
|
|
echo "----------------------------------------------------------" >> "$OUTPUT"
|
|
|
|
|
echo >> "$OUTPUT"
|
|
|
|
|
echo "${file}:" >> "$OUTPUT"
|
|
|
|
|
echo >> "$OUTPUT"
|
|
|
|
|
cat "${file}" >> "$OUTPUT"
|
|
|
|
|
echo >> "$OUTPUT"
|
2025-05-09 10:32:20 +00:00
|
|
|
done
|