gitea-package/gitea-package.sh
OCram85 ce9cb10c89
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/test-image Pipeline was successful
extend output
2024-05-14 07:06:28 +02:00

55 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env sh
set -e
say() {
if [ -n "$2" ]; then
printf "🤖 \e[32mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1"
else
printf "🤖 \e[32mgitea-package\e[0m: %s \n" "$1"
fi
}
sayE() {
if [ -n "$2" ]; then
printf "🤖 \e[31mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1" 1>&2
else
printf "🤖 \e[31mgitea-package\e[0m: %s \n" "$1" 1>&2
fi
}
sayW() {
if [ -n "$2" ]; then
printf "🤖 \e[33mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1" 1>&2
else
printf "🤖 \e[33mgitea-package\e[0m: %s \n" "$1" 1>&2
fi
}
showHelp() {
cat << HELP
🤖 gitea-package Woodpecker-CI Plugin
Syntax:
HELP
}
showENV () {
sayW "Showing plugin settings:" "showENV"
say "PLUGIN_OWNER: $PLUGIN_OWNER" "showENV"
say "PLUGIN_PACKAGE_NAME: $PLUGIN_PACKAGE_NAME" "showENV"
say "PLUGIN_PACKAGE_VERSION: $PLUGIN_PACKAGE_VERSION" "showENV"
say "PLUGIN_FILE_NAME: $PLUGIN_FILE_NAME" "showENV"
say "PLUGIN_UPDATE: $PLUGIN_UPDATE" "showENV"
}
main() {
if [ -n "$PLUGIN_DEBUG" ]; then
showENV
else
sayW "Debug mode disabled."
fi
}
main "$@"