Ensure requested image is not deployed already

This commit is contained in:
Dennis ten Hoove 2023-09-14 19:42:54 +02:00
parent f62ce8efc2
commit ed2ae159b9

View file

@ -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