File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ function add_license () {
5
5
(find " $script_path " -name $1 | grep -v " /bin/" | grep -v " /obj/" )| while read fname; do
6
6
line=$( sed -n ' 2p;3q' " $fname " )
7
7
if ! [[ " $line " == " * Licensed to Elasticsearch B.V. under one or more contributor" ]] ; then
8
- cat " ${script_path} .github/license-header.txt" " $fname " > " ${fname} .new"
8
+ # awk joins the header with the existing file, inserting a newline between them
9
+ awk ' (NR>1 && FNR==1){print ""}1' " ${script_path} .github/license-header.txt" " $fname " > " ${fname} .new"
9
10
mv " ${fname} .new" " $fname "
10
11
fi
11
12
done
Original file line number Diff line number Diff line change 16
16
* specific language governing permissions and limitations
17
17
* under the License.
18
18
*/
19
-
You can’t perform that action at this time.
0 commit comments