From d2805976a24c9eb83f6bfd00ecc528159c8ee487 Mon Sep 17 00:00:00 2001 From: Max Moroz Date: Fri, 12 Jan 2018 12:49:40 -0800 Subject: [PATCH] [infra] Increase copyright year in the templates automatically. --- infra/helper.py | 4 +++- infra/templates.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/infra/helper.py b/infra/helper.py index e0e75ede1..ae9762666 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -17,6 +17,7 @@ from __future__ import print_function import argparse +import datetime import errno import os import pipes @@ -434,7 +435,8 @@ def generate(args): print('Writing new files to', dir) template_args = { - 'project_name' : args.project_name + 'project_name' : args.project_name, + 'year': datetime.datetime.now().year } with open(os.path.join(dir, 'project.yaml'), 'w') as f: f.write(templates.PROJECT_YAML_TEMPLATE % template_args) diff --git a/infra/templates.py b/infra/templates.py index c2f955fa6..65376401d 100755 --- a/infra/templates.py +++ b/infra/templates.py @@ -20,7 +20,7 @@ primary_contact: "" """ DOCKER_TEMPLATE = """\ -# Copyright 2017 Google Inc. +# Copyright %(year)d Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ COPY build.sh $SRC/ BUILD_TEMPLATE = """\ #!/bin/bash -eu -# Copyright 2017 Google Inc. +# Copyright %(year)d Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.