#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x

cmd-plugin-install-dependencies() {
  declare desc="calls dependencies plugin trigger via command line"
  declare cmd="plugin:install-dependencies"
  [[ "$1" == "$cmd" ]] && shift 1
  declare FLAG="$1"

  if [[ "$FLAG" == "--core" ]]; then
    export PLUGIN_PATH="$PLUGIN_CORE_PATH"
  fi
  plugn trigger dependencies
}

cmd-plugin-install-dependencies "$@"
