version-and-copyright.sty 530 B

12345678910111213141516171819
  1. \ProvidesPackage{version-and-copyright}[2020/02/02 Handle Version and Copyright]
  2. \RequirePackage{verbatim}
  3. \RequirePackage{shellesc}
  4. \RequirePackage{etoolbox}
  5. \ProcessOptions\relax
  6. \newcommand\vc@getRev{\ShellEscape{git rev-parse --short HEAD > \jobname.ver}}
  7. \newcommand\gitrevision{%
  8. \vc@getRev%
  9. \edef\RestoreEndlinechar{\endlinechar=\the\endlinechar\relax}%
  10. \endlinechar=-1%
  11. \input{\jobname.ver}%
  12. \RestoreEndlinechar}
  13. \newcommand\copyrightRange[1]{\copyright~#1\ifnumgreater{\year}{#1}{--\the\year}{}}
  14. \endinput