From 2aef6a19c188a0644a5bc7d9d8f1e521748d9479 Mon Sep 17 00:00:00 2001 From: steve Date: Wed, 13 May 2026 09:57:58 -0400 Subject: [PATCH] feat: prompt user for confirmation before destroying instance --- vast_start.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vast_start.py b/vast_start.py index a3402fd..e19cb32 100644 --- a/vast_start.py +++ b/vast_start.py @@ -112,7 +112,6 @@ def create_instance(offer_id: int) -> int: return response["new_contract"] def destroy_instance(instance_id: int) -> None: - return None """Destroys a running instance.""" print(f"Destroying instance {instance_id}...") vast_request("DELETE", f"instances/{instance_id}/") @@ -260,11 +259,12 @@ def main(): finally: if instance_id: try: - input("\nPress ENTER to destroy the instance and clean up...") + should_destroy=input("\nENTER D to destroy the instance and clean up...") except (EOFError, KeyboardInterrupt): pass - print("\nCleaning up...") - destroy_instance(instance_id) + if should_destroy.strip().lower() == 'd': + print("\nCleaning up...") + destroy_instance(instance_id) if __name__ == "__main__": main()