mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 00:18:11 +01:00
Update bump-version script
This commit is contained in:
parent
f6e3070dd8
commit
bf3b678727
1 changed files with 1 additions and 9 deletions
|
@ -73,20 +73,12 @@ def write_version(version: Version):
|
|||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('new_version', type=str)
|
||||
parser.add_argument('--commit', action='store_true')
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.commit and subprocess.call(["git", "diff", "--quiet"]) == 1:
|
||||
print("Cannot use --commit because git is dirty.")
|
||||
return 1
|
||||
|
||||
version = Version.parse(args.new_version)
|
||||
print(f"Bumping to {version}")
|
||||
write_version(version)
|
||||
|
||||
if args.commit:
|
||||
subprocess.check_call(["git", "commit", "-nam", f"Bump version to v{version}"])
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in a new issue