mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-07 00:42:22 +07:00
chore(license): update license signature (#406)
This commit is contained in:
28
hack/maintenance/append_license_signature.sh
Executable file
28
hack/maintenance/append_license_signature.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Command to obtain the list of target files
|
||||
files=$(rg -F 'SPDX-License-Identifier: AGPL-3.0-only' --files-without-match --glob '*.go' --glob '!pkg/ebpf_internal/**/*.go' --glob '!pkg/geodata/**/*.go' .)
|
||||
|
||||
# Insert the specified lines to the top of each target file
|
||||
insert_lines() {
|
||||
local file="$1"
|
||||
if [ -f "$file" ]; then
|
||||
# Inserting lines at the beginning of the file
|
||||
{
|
||||
echo "/*"
|
||||
echo "* SPDX-License-Identifier: AGPL-3.0-only"
|
||||
echo "* Copyright (c) 2022-2024, daeuniverse Organization <dae@v2raya.org>"
|
||||
echo "*/"
|
||||
echo
|
||||
cat "$file"
|
||||
} >tempfile && mv tempfile "$file"
|
||||
echo "Lines inserted into $file"
|
||||
else
|
||||
echo "File not found: $file"
|
||||
fi
|
||||
}
|
||||
|
||||
# Loop through each file and insert lines to the top
|
||||
while IFS= read -r file; do
|
||||
insert_lines "$file"
|
||||
done <<<"$files"
|
4
hack/maintenance/extend_license_signature_period.sh
Normal file
4
hack/maintenance/extend_license_signature_period.sh
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
rg -F 'Copyright (c) 2022-2023' --files-with-matches . | xargs sed -i 's/Copyright (c) 2022-2023/Copyright (c) 2022-2024'/g
|
||||
rg -F 'Copyright (c) 2023' --files-with-matches . | xargs sed -i 's/Copyright (c) 2022-2023/Copyright (c) 2022-2024'/g
|
Reference in New Issue
Block a user