Skip to content

Commit

Permalink
Remove fancy checking of status when comitting yamsql updates (#3087)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottDugas authored Feb 3, 2025
1 parent 07142c1 commit b46dac7
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions build/commit_yamsql_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,9 @@ def main(argv):
parser = argparse.ArgumentParser()
parser.add_argument('new_version', help='New version to use when updating the yamsql files')
args = parser.parse_args(argv)

process = subprocess.run(['git', 'status', '--porcelain=v1', '--untracked=no', '--no-renames'],
check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
should_commit = False
for line in process.stdout.splitlines():
indexState = line[0]
if indexState != ' ':
if line.endswith('.yamsql'):
should_commit = True
else:
print("Unexpected change: " + line)
exit(1)

if should_commit:
print("Updating !current_version in yamsql files to " + args.new_version)
subprocess.run(['git', 'commit', '-m', "Updating !current_version in yamsql files to " + args.new_version],
check=True)
else:
print("Nothing to commit")
print("Updating !current_version in yamsql files to " + args.new_version)
subprocess.run(['git', 'commit', '-m', "Updating !current_version in yamsql files to " + args.new_version],
check=True)

if __name__ == '__main__':
main(sys.argv[1:])

0 comments on commit b46dac7

Please sign in to comment.