Fix volume/secret deletion logic

- Fix escaping of quotes
- Dont delete things unless options are passed
This commit is contained in:
Luke Murphy 2021-03-04 19:21:38 +01:00
parent 7434b67c34
commit 621c8cd5c4
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

12
abra
View File

@ -1135,16 +1135,20 @@ sub_app_delete (){
prompt_confirm
fi
# shellcheck disable=SC2086
docker volume rm --force "$(docker volume ls --filter \"name=${STACK_NAME}\" --quiet)"
if [ "$abra___volumes" = "true" ]; then
# shellcheck disable=SC2086
docker volume rm --force "$(docker volume ls --filter "name=${STACK_NAME}" --quiet)"
fi
if [ "$abra___force" != "true" ] && [ "$abra___secrets" = "true" ]; then
warning "SCARY: About to remove all secrets associated with ${STACK_NAME}"
prompt_confirm
fi
# shellcheck disable=SC2086
docker secret rm --force "$(docker secret ls --filter \"name=${STACK_NAME}\" --quiet)"
if [ "$abra___secrets" = "true" ]; then
# shellcheck disable=SC2086
docker secret rm "$(docker secret ls --filter "name=${STACK_NAME}" --quiet)"
fi
}
###### .. app secret insert