summaryrefslogtreecommitdiff
path: root/mix.exs
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2021-01-16 02:38:37 +0100
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2021-01-16 02:42:53 +0100
commit3e0d1588a45d1e0d6b23ad2d39050098bc445269 (patch)
tree06d3f1fad01a4c4a87edd9347d773435cf6327e7 /mix.exs
parenta17a9dcc4d5f3d8f27769d334462c54d6b457230 (diff)
mix.exs: Make copyright regexes more precise
- Add copyright checks for Pleroma's not any copyright - Copyright bump fixes the whole line instead of just the year
Diffstat (limited to 'mix.exs')
-rw-r--r--mix.exs11
1 files changed, 6 insertions, 5 deletions
diff --git a/mix.exs b/mix.exs
index 79d9783c4..26b52b0cb 100644
--- a/mix.exs
+++ b/mix.exs
@@ -345,18 +345,19 @@ defmodule Pleroma.Mixfile do
] |> String.replace("\n", "\\n")
find = "find lib test priv -type f \\( -name '*.ex' -or -name '*.exs' \\) -exec "
- grep = "grep -L '# Copyright' {} \\; |"
+ grep = "grep -L '# Copyright © [0-9\-]* Pleroma' {} \\;"
xargs = "xargs -n1 sed -i'' '1s;^;#{template};'"
- :os.cmd(String.to_charlist("#{find}#{grep}#{xargs}"))
+ :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' \\) |"
+ 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}/'"
+ xargs =
+ "xargs sed -i'' 's;# Copyright © [0-9\-]* Pleroma.*$;# Copyright © 2017-#{year} Pleroma Authors <https://pleroma.social/>;'"
- :os.cmd(String.to_charlist("#{find}#{xargs}"))
+ :os.cmd(String.to_charlist("#{find} | #{xargs}"))
end
end