mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 17:54:13 +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():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('new_version', type=str)
|
parser.add_argument('new_version', type=str)
|
||||||
parser.add_argument('--commit', action='store_true')
|
|
||||||
args = parser.parse_args()
|
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)
|
version = Version.parse(args.new_version)
|
||||||
print(f"Bumping to {version}")
|
print(f"Bumping to {version}")
|
||||||
write_version(version)
|
write_version(version)
|
||||||
|
return 0
|
||||||
if args.commit:
|
|
||||||
subprocess.check_call(["git", "commit", "-nam", f"Bump version to v{version}"])
|
|
||||||
return 1
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue