2016-03-01 13:26:35 -08:00
|
|
|
#!/usr/bin/env bash
|
2019-01-07 01:04:17 -05:00
|
|
|
set -eo pipefail
|
|
|
|
|
[[ $DOKKU_TRACE ]] && set -x
|
2018-04-27 12:33:33 -04:00
|
|
|
source "$PLUGIN_AVAILABLE_PATH/plugin/internal-functions"
|
2016-03-01 13:26:35 -08:00
|
|
|
|
2020-02-09 22:41:39 -05:00
|
|
|
cmd-plugin-update() {
|
2016-03-08 15:30:34 -05:00
|
|
|
declare desc="updates plugin to optional committish and calls update plugin trigger via command line"
|
2020-02-10 01:40:30 -05:00
|
|
|
declare cmd="plugin:update"
|
|
|
|
|
[[ "$1" == "$cmd" ]] && shift 1
|
|
|
|
|
declare PLUGIN="$1" PLUGIN_COMMITTISH="$2"
|
|
|
|
|
|
|
|
|
|
if [[ -n "$PLUGIN" ]]; then
|
2016-03-01 13:26:35 -08:00
|
|
|
plugn update "$PLUGIN" "$PLUGIN_COMMITTISH"
|
|
|
|
|
fi
|
|
|
|
|
plugn trigger update
|
2018-04-27 04:09:53 -04:00
|
|
|
plugin_prime_bash_completion
|
2016-03-01 13:26:35 -08:00
|
|
|
}
|
|
|
|
|
|
2020-02-09 22:41:39 -05:00
|
|
|
cmd-plugin-update "$@"
|