diff options
author | Jürg Billeter <j@bitron.ch> | 2019-08-01 12:42:16 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-08-01 12:47:33 +0200 |
commit | 1490de725097a6c7310fc56862180867cf1b24d3 (patch) | |
tree | ce506ae95e6bf09f508bd16a882fd63e6768ee8b /contrib | |
parent | 59e0812c03d4ceaa86879171296542517c473db0 (diff) | |
download | buildstream-1490de725097a6c7310fc56862180867cf1b24d3.tar.gz |
contrib/update_committers.py: Move COMMITTERS.rst to top-level directory
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/update_committers.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/update_committers.py b/contrib/update_committers.py index f2bdb9026..27dbc5abf 100755 --- a/contrib/update_committers.py +++ b/contrib/update_committers.py @@ -58,22 +58,23 @@ def find_repository_root() -> str: def create_committers_file(committers: OrderedDict): - contrib_directory = os.path.join(find_repository_root(), 'contrib') + repository_root = find_repository_root() + contrib_directory = os.path.join(repository_root, 'contrib') file_loader = FileSystemLoader(contrib_directory) env = Environment(loader=file_loader) template = env.get_template('COMMITTERS.rst.j2') render_output = template.render(committers=committers, get_table_entry=get_table_entry) - committers_file = os.path.join(contrib_directory, 'COMMITTERS.rst') + committers_file = os.path.join(repository_root, 'COMMITTERS.rst') with open(committers_file, 'w') as f: f.write(render_output) def commit_changes_if_needed(token: str): - committers_file = os.path.join(find_repository_root(), 'contrib/COMMITTERS.rst') + committers_file = os.path.join(find_repository_root(), 'COMMITTERS.rst') git_diff = subprocess.call('git diff --quiet {}'.format(committers_file), shell=True) if git_diff: - commit_message = '\'contrib: Update COMMITTERS.rst\'' + commit_message = '\'Update COMMITTERS.rst\'' branch_name = 'update_committers' subprocess.call('git add {}'.format(committers_file), shell=True) subprocess.call('git commit -m {}'.format(commit_message), shell=True) |