#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"

trigger-openresty-vhosts-post-delete() {
  declare desc="openresty-vhosts post-delete trigger"
  declare trigger="post-delete"
  declare APP="$1"

  fn-plugin-property-destroy "openresty" "$APP"
  rm -rf "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP"
}

trigger-openresty-vhosts-post-delete "$@"
