Skip to content

Commit

Permalink
use current year instead of a hard-coded year
Browse files Browse the repository at this point in the history
  • Loading branch information
craigahobbs committed Dec 1, 2023
1 parent fce5a75 commit 761b66a
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 10 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ gh-pages:
superclean: clean


# Helper to edit files with sed
SED_FILE = if [ -f $(strip $(2)) ]; then sed -E $(strip $(1)) $(strip $(2)) >> $(strip $(2)).tmp && mv $(strip $(2)).tmp $(strip $(2)); fi


# Test rule function - name, template args, *env
define TEST_RULE
test: test-$(strip $(1))
Expand All @@ -36,6 +40,8 @@ test-$(strip $(1)): build/venv.build
@echo 'Testing "$(strip $(1))"...'
rm -rf test-actual/$(strip $(1))/
build/venv/bin/template-specialize template/ test-actual/$(strip $(1))/ $(strip $(2))
$(call SED_FILE, 's/[0-9]{4}(,? John Doe)/YYYY\1/g', test-actual/$(strip $(1))/LICENSE)
$(call SED_FILE, 's/[0-9]{4}(,? John Doe)/YYYY\1/g', test-actual/$(strip $(1))/doc/conf.py)
diff -r test-actual/$(strip $(1))/ test-expected/$(strip $(1))/
$(if $(3),$(strip $(3)) )$$(MAKE) $(MAKEJ) -C test-actual/$(strip $(1))/ commit
rm -rf test-actual/$(strip $(1))/
Expand Down
2 changes: 1 addition & 1 deletion template/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 {{name}}
Copyright (c) {{now.year}} {{name}}

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion template/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# -- Project information -----------------------------------------------------

project = '{{package}}'
copyright = '2022, {{name}}'
copyright = '{{now.year}}, {{name}}'
author = '{{name}}'

# The full version, including alpha/beta/rc tags
Expand Down
2 changes: 1 addition & 1 deletion test-expected/noapi-0-nomain-0/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 John Doe
Copyright (c) YYYY John Doe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion test-expected/noapi-0-nomain-0/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# -- Project information -----------------------------------------------------

project = 'my-package'
copyright = '2022, John Doe'
copyright = 'YYYY, John Doe'
author = 'John Doe'

# The full version, including alpha/beta/rc tags
Expand Down
2 changes: 1 addition & 1 deletion test-expected/noapi-nomain/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 John Doe
Copyright (c) YYYY John Doe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion test-expected/noapi/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 John Doe
Copyright (c) YYYY John Doe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion test-expected/nomain/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 John Doe
Copyright (c) YYYY John Doe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion test-expected/nomain/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# -- Project information -----------------------------------------------------

project = 'my-package'
copyright = '2022, John Doe'
copyright = 'YYYY, John Doe'
author = 'John Doe'

# The full version, including alpha/beta/rc tags
Expand Down
2 changes: 1 addition & 1 deletion test-expected/required/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 John Doe
Copyright (c) YYYY John Doe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion test-expected/required/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# -- Project information -----------------------------------------------------

project = 'my-package'
copyright = '2022, John Doe'
copyright = 'YYYY, John Doe'
author = 'John Doe'

# The full version, including alpha/beta/rc tags
Expand Down

0 comments on commit 761b66a

Please sign in to comment.