mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -23,6 +23,9 @@ dist/
|
||||
# exclude the copy of swagger.yaml moved into assets during packaging
|
||||
web/assets/swagger.yaml
|
||||
|
||||
# exclude the copy of all_licenses.txt moved into assets during packaging
|
||||
web/assets/all_licenses.txt
|
||||
|
||||
# exludes docker-volume from exemple/docker-compose
|
||||
example/docker-compose/docker-volume
|
||||
|
||||
|
@@ -17,6 +17,8 @@ before:
|
||||
- yarn --cwd ./web/source install
|
||||
- yarn --cwd ./web/source ts-patch install # https://typia.io/docs/setup/#manual-setup
|
||||
- yarn --cwd ./web/source build
|
||||
# Bundle all licenses into web/assets/all_licenses.txt
|
||||
- ./scripts/bundle_licenses.sh
|
||||
|
||||
# https://goreleaser.com/customization/build/
|
||||
builds:
|
||||
|
34
scripts/bundle_licenses.sh
Executable file
34
scripts/bundle_licenses.sh
Executable file
@@ -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
|
Reference in New Issue
Block a user