diff options
author | Félix Piédallu <felix@piedallu.me> | 2020-05-12 11:27:50 +0200 |
---|---|---|
committer | Hans Petter Jansson <hpj@cl.no> | 2020-06-18 16:56:05 +0200 |
commit | 46d5759e3c81c610cb9c49b212e744a10ff9553a (patch) | |
tree | 785c73fce2ae310edb4511137cef03774639c386 /changelog.py | |
parent | 4cd0852d6ef08a8419a7f6d358e9f8232e65d05b (diff) |
Use python for scripts instead of bash
Diffstat (limited to 'changelog.py')
-rwxr-xr-x | changelog.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/changelog.py b/changelog.py new file mode 100755 index 0000000..ac41e30 --- /dev/null +++ b/changelog.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +import os, subprocess +from pathlib import Path + +changelog_path = Path( + os.getenv('MESON_DIST_ROOT') + or os.getenv('MESON_SOURCE_ROOT') + or Path(__file__).parent +) / 'ChangeLog' + +print('Writing changelog to {path}'.format(path=changelog_path)) + +with open(changelog_path, 'w') as changelog_file: + changelog = subprocess.check_output([ + 'git', 'log', + '--no-color', + '--find-renames', + '--find-copies', + '--name-status' + ]).decode() + changelog_file.write(changelog) |