chore(license): update license signature (#406)

This commit is contained in:
Sumire (菫)
2024-01-04 17:28:16 +08:00
committed by GitHub
parent cd9119048f
commit 3184aa5abd
118 changed files with 219 additions and 107 deletions

View 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"

View 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