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

apps_create() {
  declare desc="verifies app name and creates an app"
  declare APP="$1"
  declare deprecated=true

  dokku_log_warn "Deprecated: plugn#app-create"
  plugn trigger app-create "$APP"
}

apps_destroy() {
  declare desc="destroys an app"
  declare APP="$1"
  declare deprecated=true

  dokku_log_warn "Deprecated: plugn#app-destroy"
  plugn trigger app-destroy "$APP"
}

apps_exists() {
  declare desc="checks if an app exists"
  declare APP="$1"
  declare deprecated=true

  dokku_log_warn "Deprecated: plugn#app-exists"
  plugn trigger app-exists "$APP"
}

apps_maybe_create() {
  declare desc="creates an app dir if allowed"
  declare APP="$1"
  declare deprecated=true

  dokku_log_warn "Deprecated: plugn#app-maybe-create"
  plugn trigger app-maybe-create "$APP"
}
