|
| 1 | +#!/bin/bash |
| 2 | +# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"). You may |
| 5 | +# not use this file except in compliance with the License. A copy of the |
| 6 | +# License is located at |
| 7 | +# |
| 8 | +# http://aws.amazon.com/apache2.0/ |
| 9 | +# |
| 10 | +# or in the "license" file accompanying this file. This file is distributed |
| 11 | +# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 12 | +# express or implied. See the License for the specific language governing |
| 13 | +# permissions and limitations under the License. |
| 14 | +# |
| 15 | +# This script generates a file in go with the license contents as a constant |
| 16 | + |
| 17 | +set -e |
| 18 | +outputfile=${1?Must provide an output file} |
| 19 | +inputfile="$(<../../LICENSE)" |
| 20 | + |
| 21 | +for user in ./../vendor/src/github.com/*; do |
| 22 | + for repo in $user/*; do |
| 23 | + inputfile+=$'\n'"***"$'\n'"$repo"$'\n\n' |
| 24 | + inputfile+="$(<$repo/LICENSE*)"$'\n' |
| 25 | + done; |
| 26 | +done; |
| 27 | + |
| 28 | +cat << EOF > "${outputfile}" |
| 29 | +// Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 30 | +// |
| 31 | +// Licensed under the Apache License, Version 2.0 (the "License"). You may |
| 32 | +// not use this file except in compliance with the License. A copy of the |
| 33 | +// License is located at |
| 34 | +// |
| 35 | +// http://aws.amazon.com/apache2.0/ |
| 36 | +// |
| 37 | +// or in the "license" file accompanying this file. This file is distributed |
| 38 | +// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 39 | +// express or implied. See the License for the specific language governing |
| 40 | +// permissions and limitations under the License. |
| 41 | +
|
| 42 | +package license |
| 43 | +
|
| 44 | +const License = \`$inputfile\` |
| 45 | +EOF |
0 commit comments