#!/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