Skip to content

Commit c6616b2

Browse files
authored
Merge pull request digitalocean#128 from digitalocean/scripts-license
scripts: add license.txt to reduce duplication
2 parents ef17abe + 98ff1ea commit c6616b2

File tree

3 files changed

+15
-30
lines changed

3 files changed

+15
-30
lines changed

scripts/license.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2016 The go-qemu Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.

scripts/licensecheck.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,7 @@
22

33
# Verify that the correct license block is present in all Go source
44
# files.
5-
read -r -d '' EXPECTED <<EndOfLicense
6-
// Copyright 2016 The go-qemu Authors.
7-
//
8-
// Licensed under the Apache License, Version 2.0 (the "License");
9-
// you may not use this file except in compliance with the License.
10-
// You may obtain a copy of the License at
11-
//
12-
// http://www.apache.org/licenses/LICENSE-2.0
13-
//
14-
// Unless required by applicable law or agreed to in writing, software
15-
// distributed under the License is distributed on an "AS IS" BASIS,
16-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
// See the License for the specific language governing permissions and
18-
// limitations under the License.
19-
EndOfLicense
5+
EXPECTED=$(cat ./scripts/license.txt)
206

217
# Scan each Go source file for license.
228
EXIT=0

scripts/prependlicense.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
11
#!/bin/bash
22

33
# License block to be prepended to file
4-
read -r -d '' LICENSE <<EndOfLicense
5-
// Copyright 2016 The go-qemu Authors.
6-
//
7-
// Licensed under the Apache License, Version 2.0 (the "License");
8-
// you may not use this file except in compliance with the License.
9-
// You may obtain a copy of the License at
10-
//
11-
// http://www.apache.org/licenses/LICENSE-2.0
12-
//
13-
// Unless required by applicable law or agreed to in writing, software
14-
// distributed under the License is distributed on an "AS IS" BASIS,
15-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
// See the License for the specific language governing permissions and
17-
// limitations under the License.
18-
EndOfLicense
4+
LICENSE=$(cat ./scripts/license.txt)
195

206
if [ -z "$1" ]; then
217
echo "missing filename argument"

0 commit comments

Comments
 (0)