From 0ef276d40b30cfb7447c4bff840384c0066d61b9 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 20 Nov 2025 03:11:49 -0500 Subject: [PATCH] feat: add aliases for select builder and scheduler plugins It can get repetitive to specify 'builder-' or 'scheduler-' prefixes for builder and scheduler commands. As these are mostly unique, Dokku now provides built-in aliases for the commands. Dokku still uses the long-form in all it's documentation, but these are a nice easter egg for determined users :) Note that the null builder/scheduler plugins do not have aliases as they would shadow each other. --- dokku | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dokku b/dokku index cd8a381a4..879e0e0cd 100755 --- a/dokku +++ b/dokku @@ -135,6 +135,28 @@ execute_dokku_cmd() { local script local argv=("$@") + local -A PLUGIN_ALIASES=( + [docker-local]="scheduler-docker-local" + [dockerfile]="builder-dockerfile" + [herokuish]="builder-herokuish" + [k3s]="scheduler-k3s" + [lambda]="builder-lambda" + [nixpacks]="builder-nixpacks" + [pack]="builder-pack" + [rails]="builder-railpack" + ) + + local plugin_alias_source="${PLUGIN_NAME%%:*}" + local plugin_alias_target="${PLUGIN_ALIASES[$plugin_alias_source]}" + if [[ -n "$plugin_alias_target" ]]; then + PLUGIN_NAME="${PLUGIN_NAME/$plugin_alias_source/$plugin_alias_target}" + PLUGIN_CMD="${PLUGIN_CMD/$plugin_alias_source/$plugin_alias_target}" + # also replace the first argument in $@ with the new PLUGIN_NAME + shift 1 + set -- "$PLUGIN_NAME" "$@" + argv=("$PLUGIN_NAME" "${argv[@]:1}") + fi + case "$PLUGIN_NAME" in events | events:*) local PLUGIN_NAME=${PLUGIN_NAME/events/20_events}