Files
drone-xgettext-go/plugin.sh
decentral1se cb11ca1bbf
All checks were successful
continuous-integration/drone/pr Build is passing
feat: forked xgettext-go
2025-09-30 19:17:34 +02:00

34 lines
758 B
Bash
Executable File

#!/bin/sh
set -ex
PLUGIN_IN=${PLUGIN_IN:-/drone/src/}
PLUGIN_OUT=${PLUGIN_OUT:-/drone/src/locales/default.pot}
PLUGIN_KEYWORD=${PLUGIN_KEYWORD:-gotext.Get}
PLUGIN_KEYWORD_CTX=${PLUGIN_KEYWORD_CTX:-gotext.GetC}
run_xgettext_cmd() {
echo "--- start command ---"
cd "$PLUGIN_IN" || exit 1
# shellcheck disable=SC2046 disable=SC2086
xgettext-go \
-o "$PLUGIN_OUT" \
--keyword="$PLUGIN_KEYWORD" \
--keyword-ctx="$PLUGIN_KEYWORD_CTX" \
--sort-output \
${PLUGIN_COMMENTS_TAG:+--add-comments-tag=}${PLUGIN_COMMENTS_TAG}\
$(find . -name "*.go" -not -path '*vendor*' | sort)
echo "--- end command ---"
}
run_plugin() {
echo "--- start drone-xgettext-go ---"
run_xgettext_cmd
echo "--- end drone-xettext-go ---"
}
run_plugin