From e1ca577566e9f6d2d53d74bfef0254993767d24b Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 24 Sep 2018 19:01:49 +0200 Subject: [PATCH] Set current year in generator templates (#8396) --- CHANGELOG-developer.asciidoc | 1 + generator/beat/{beat}/LICENSE.txt | 2 +- generator/beat/{beat}/NOTICE.txt | 2 +- generator/metricbeat/{beat}/LICENSE.txt | 2 +- generator/metricbeat/{beat}/NOTICE.txt | 2 +- script/generate.py | 6 ++++-- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG-developer.asciidoc b/CHANGELOG-developer.asciidoc index a9347474bd0b..62c233890a5d 100644 --- a/CHANGELOG-developer.asciidoc +++ b/CHANGELOG-developer.asciidoc @@ -49,3 +49,4 @@ The list below covers the major changes between 6.3.0 and master only. - Move filebeat/reader to libbeat/reader {pull}8206[8206] - Libbeat provides a new function `cmd.GenRootCmdWithSettings` that should be preferred over deprecated functions `cmd.GenRootCmd`, `cmd.GenRootCmdWithRunFlags`, and `cmd.GenRootCmdWithIndexPrefixWithRunFlags`. {pull}7850[7850] +- Set current year in generator templates. {pull}8396[8396] diff --git a/generator/beat/{beat}/LICENSE.txt b/generator/beat/{beat}/LICENSE.txt index a6c296d81a68..3e5c88efac89 100644 --- a/generator/beat/{beat}/LICENSE.txt +++ b/generator/beat/{beat}/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2017 {full_name} +Copyright (c) {year} {full_name} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/generator/beat/{beat}/NOTICE.txt b/generator/beat/{beat}/NOTICE.txt index 3898d85d3ba7..b10d905153e1 100644 --- a/generator/beat/{beat}/NOTICE.txt +++ b/generator/beat/{beat}/NOTICE.txt @@ -1,5 +1,5 @@ {beat} -Copyright 2017 {full_name} +Copyright {year} {full_name} This product includes software developed by The Apache Software Foundation (http://www.apache.org/). diff --git a/generator/metricbeat/{beat}/LICENSE.txt b/generator/metricbeat/{beat}/LICENSE.txt index a6c296d81a68..3e5c88efac89 100644 --- a/generator/metricbeat/{beat}/LICENSE.txt +++ b/generator/metricbeat/{beat}/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2017 {full_name} +Copyright (c) {year} {full_name} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/generator/metricbeat/{beat}/NOTICE.txt b/generator/metricbeat/{beat}/NOTICE.txt index 3898d85d3ba7..b10d905153e1 100644 --- a/generator/metricbeat/{beat}/NOTICE.txt +++ b/generator/metricbeat/{beat}/NOTICE.txt @@ -1,5 +1,5 @@ {beat} -Copyright 2017 {full_name} +Copyright {year} {full_name} This product includes software developed by The Apache Software Foundation (http://www.apache.org/). diff --git a/script/generate.py b/script/generate.py index 2d9342ce2205..9ffaf778a189 100644 --- a/script/generate.py +++ b/script/generate.py @@ -1,5 +1,6 @@ -import os import argparse +import datetime +import os # Creates a new beat or metricbeat based on the given parameters @@ -97,7 +98,8 @@ def replace_variables(content): .replace("{beat}", beat) \ .replace("{Beat}", beat.capitalize()) \ .replace("{beat_path}", beat_path) \ - .replace("{full_name}", full_name) + .replace("{full_name}", full_name) \ + .replace("{year}", str(datetime.datetime.now().year)) def get_parser():