Include license notices (#255)

This commit is contained in:
Sung Won Cho 2019-09-30 11:55:11 +08:00 committed by GitHub
commit 1250825578
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
198 changed files with 2713 additions and 244 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eux
function remove_notice {
sed -i -e '/\/\* Copyright/,/\*\//d' "$1"
@ -20,20 +21,20 @@ END
gpl="/* Copyright (C) 2019 Monomax Software Pty Ltd
*
* This file is part of Dnote CLI.
* This file is part of Dnote.
*
* Dnote CLI is free software: you can redistribute it and/or modify
* Dnote is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Dnote CLI is distributed in the hope that it will be useful,
* Dnote is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dnote CLI. If not, see <https://www.gnu.org/licenses/>.
* along with Dnote. If not, see <https://www.gnu.org/licenses/>.
*/"
agpl="/* Copyright (C) 2019 Monomax Software Pty Ltd
@ -54,18 +55,20 @@ agpl="/* Copyright (C) 2019 Monomax Software Pty Ltd
* along with Dnote. If not, see <https://www.gnu.org/licenses/>.
*/"
pkgPath="$GOPATH"/src/github.com/dnote/dnote/pkg
serverPath="$GOPATH"/src/github.com/dnote/dnote/pkg/server
pkgPath="$GOPATH/src/github.com/dnote/dnote/pkg"
serverPath="$GOPATH/src/github.com/dnote/dnote/pkg/server"
browserPath="$GOPATH/src/github.com/dnote/dnote/browser"
pkgFiles=$(find "$pkgPath" -type f -name "*.go" ! -path "**/vendor/*" ! -path "$serverPath/*")
gplFiles=$(find "$pkgPath" "$browserPath" -type f \( -name "*.go" -o -name "*.js" -o -name "*.ts" -o -name "*.tsx" -o -name "*.scss" -o -name "*.css" \) ! -path "**/vendor/*" ! -path "**/node_modules/*" ! -path "$serverPath/*")
for file in $pkgFiles; do
for file in $gplFiles; do
remove_notice "$file"
add_notice "$file" "$gpl"
done
webPath="$GOPATH"/src/github.com/dnote/dnote/web
agplFiles=$(find "$serverPath" "$webPath" -type f \( -name "*.go" -o -name "*.js" -o -name "*.scss" \) ! -path "**/vendor/*" ! -path "**/node_modules/*")
jslibPath="$GOPATH/src/github.com/dnote/dnote/jslib/src"
agplFiles=$(find "$serverPath" "$webPath" "$jslibPath" -type f \( -name "*.go" -o -name "*.js" -o -name "*.ts" -o -name "*.tsx" -o -name "*.scss" -o -name "*.css" \) ! -path "**/vendor/*" ! -path "**/node_modules/*" ! -path "**/dist/*")
for file in $agplFiles; do
remove_notice "$file"