depcheck: Commit updates automatically
This commit is contained in:
@@ -63,12 +63,16 @@ for tier in ["dependencies", "dev-dependencies"]:
|
|||||||
f"{name}: New version found: {latest_version} (current {current_version})"
|
f"{name}: New version found: {latest_version} (current {current_version})"
|
||||||
)
|
)
|
||||||
cargo[tier][name]["version"] = f"={str(latest_version)}"
|
cargo[tier][name]["version"] = f"={str(latest_version)}"
|
||||||
|
with open("../Cargo.toml", "w") as cargo_config:
|
||||||
|
cargo_config.write(tomlkit.dumps(cargo))
|
||||||
|
|
||||||
|
message = f"dependencies: Update {name} to {latest_version}"
|
||||||
|
subprocess.run(
|
||||||
|
["git", "commit", "--message", message, "../Cargo.toml"],
|
||||||
|
check=True,
|
||||||
|
capture_output=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if update_necessary is True:
|
if update_necessary is False:
|
||||||
with open("../Cargo.toml", "w") as cargo_config:
|
|
||||||
cargo_config.write(tomlkit.dumps(cargo))
|
|
||||||
sys.exit(1)
|
|
||||||
else:
|
|
||||||
print("Everything up to date")
|
print("Everything up to date")
|
||||||
sys.exit(0)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user