From 5814b367305f1d49c7eb6bfa320f92d3cbedcb81 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Wed, 27 Sep 2023 14:48:14 -0600 Subject: [PATCH] Implement --check-only --- app/update.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/app/update.py b/app/update.py index ed1a1d6a..79e5360a 100644 --- a/app/update.py +++ b/app/update.py @@ -72,8 +72,19 @@ def command(ctx, check_only): # Check if the downloaded file is identical to the existing one same = filecmp.cmp(temp_download_path, shiv_binary_path) if same: + if not ctx.obj.quiet or check_only: + print("No update available, latest version already installed") + else: if not ctx.obj.quiet: - print("Up update available, latest version already installed") - if ctx.obj.verbose: - print(f"Replacing: {shiv_binary_path} with {temp_download_path}") - os.replace(temp_download_path, shiv_binary_path) + print("Update available") + if check_only: + if not ctx.obj.quiet: + print("Check-only node, update not installed") + else: + if not ctx.obj.quiet: + print("Installing...") + if ctx.obj.verbose: + print(f"Replacing: {shiv_binary_path} with {temp_download_path}") + os.replace(temp_download_path, shiv_binary_path) + if not ctx.obj.quiet: + print("Done. Run \"laconic-so version\" to see the newly installed version")