mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
feat: create tar:default alias for tar:help
This commit is contained in:
@@ -1,27 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
[[ " help tar:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
source "$PLUGIN_AVAILABLE_PATH/tar/internal-functions"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
case "$1" in
|
||||
help | tar:help)
|
||||
help_content_func () {
|
||||
declare desc="return tar plugin help content"
|
||||
cat<<help_content
|
||||
tar:in <app>, Reads an tarball containing the app from stdin
|
||||
tar:from <app> <url>, Loads an app tarball from url
|
||||
help_content
|
||||
}
|
||||
|
||||
if [[ $1 = "tar:help" ]] ; then
|
||||
echo -e 'Usage: dokku tar[:COMMAND]'
|
||||
echo ''
|
||||
echo 'An alternative to using git, apps are loaded via tarballs instead.'
|
||||
echo ''
|
||||
echo 'Additional commands:'
|
||||
help_content_func | sort | column -c2 -t -s,
|
||||
else
|
||||
help_content_func
|
||||
fi
|
||||
tar_help_cmd "$1"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
27
plugins/tar/internal-functions
Normal file
27
plugins/tar/internal-functions
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
tar_help_content_func() {
|
||||
declare desc="return tar plugin help content"
|
||||
cat<<help_content
|
||||
tar:in <app>, Reads an tarball containing the app from stdin
|
||||
tar:from <app> <url>, Loads an app tarball from url
|
||||
help_content
|
||||
}
|
||||
|
||||
tar_help_cmd() {
|
||||
if [[ $1 = "tar:help" ]] ; then
|
||||
echo -e 'Usage: dokku tar[:COMMAND]'
|
||||
echo ''
|
||||
echo 'An alternative to using git, apps are loaded via tarballs instead.'
|
||||
echo ''
|
||||
echo 'Additional commands:'
|
||||
tar_help_content_func | sort | column -c2 -t -s,
|
||||
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
|
||||
tar_help_content_func
|
||||
else
|
||||
cat<<help_desc
|
||||
tar, Deploy applications via tarball instead of git
|
||||
help_desc
|
||||
fi
|
||||
}
|
||||
5
plugins/tar/subcommands/default
Executable file
5
plugins/tar/subcommands/default
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/tar/internal-functions"
|
||||
|
||||
tar_help_cmd "tar:help"
|
||||
Reference in New Issue
Block a user