Explorar el Código

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
groups
Haelwenn (lanodan) Monnier hace 3 años
padre
commit
3e0d1588a4
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: D5B7A8E43C997DEE
Se han modificado 1 ficheros con 6 adiciones y 5 borrados
  1. +6
    -5
      mix.exs

+ 6
- 5
mix.exs Ver fichero

@@ -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

Cargando…
Cancelar
Guardar