From ed2ae159b99ee1e8c7b4cced257b4d5a16e51597 Mon Sep 17 00:00:00 2001 From: Dennis ten Hoove Date: Thu, 14 Sep 2023 19:42:54 +0200 Subject: [PATCH] Ensure requested image is not deployed already --- arkanium-deploy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arkanium-deploy b/arkanium-deploy index 227179e..19e28de 100755 --- a/arkanium-deploy +++ b/arkanium-deploy @@ -217,12 +217,15 @@ deploy () { # A carriage feed is inserted for some reason, lets remove it data[2]=${data[2]//[$'\t\r\n']} + # Lets ensure the requested image is not already deployed + if [[ -e $arkanium_dir/deployments/${data[0]} ]]; then + printf "\e[1;33m\e[0m\e[1m ${data[0]} is already deployed, canceling deployment\e[0m\n" + exit 0 + fi # Check if requested version is already downloaded if [[ -e $arkanium_dir/cache/${data[0]}.tar.${data[1]} ]]; then - printf "\e[1;34m-->\e[0m\e[1m ${data[0]} already in cache, skipping download\e[0m\n" - else # Download the tarball if not yet downloaded