summaryrefslogtreecommitdiff
path: root/mix.exs
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2021-01-15 17:26:02 -0600
committerMark Felder <feld@feld.me>2021-01-15 17:26:02 -0600
commit23c6cea889658b5a03b113854f0489ee2da147c7 (patch)
tree33886c6410ef536fc5d5bf2438851aea0569938d /mix.exs
parent41a637c3a66cc68efddb84d3e888c6c21787c1c9 (diff)
Add a mix alias to bump copyright
Diffstat (limited to 'mix.exs')
-rw-r--r--mix.exs12
1 files changed, 11 insertions, 1 deletions
diff --git a/mix.exs b/mix.exs
index 1bfca0b47..281cca643 100644
--- a/mix.exs
+++ b/mix.exs
@@ -230,7 +230,8 @@ defmodule Pleroma.Mixfile do
test: ["ecto.create --quiet", "ecto.migrate", "test"],
docs: ["pleroma.docs", "docs"],
analyze: ["credo --strict --only=warnings,todo,fixme,consistency,readability"],
- copyright: &add_copyright/1
+ copyright: &add_copyright/1,
+ "copyright.bump": &bump_copyright/1
]
end
@@ -349,4 +350,13 @@ defmodule Pleroma.Mixfile do
:os.cmd(String.to_charlist("#{find}#{grep}#{xargs}"))
end
+
+ defp bump_copyright(_) do
+ year = NaiveDateTime.utc_now().year
+ find = "find lib test priv -type f \\( -name '*.ex' -or -name '*.exs' \\) |"
+
+ xargs = "xargs sed -i '' 's/# Copyright © 2017-20[0-9][0-9]/# Copyright © 2017-#{year}/'"
+
+ :os.cmd(String.to_charlist("#{find}#{xargs}"))
+ end
end