From 26026675afbba4191c8d466d9ac6a7c98f9e6f4a Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Sat, 22 Sep 2018 13:14:08 +0200 Subject: [PATCH] Set current year in generator templates --- 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 a9347474bd0..62c233890a5 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 a6c296d81a6..3e5c88efac8 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 3898d85d3ba..b10d905153e 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 a6c296d81a6..3e5c88efac8 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 3898d85d3ba..b10d905153e 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 2d9342ce220..9ffaf778a18 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():