32 lines
662 B
Bash
Executable File
32 lines
662 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}
|
|
|
|
run_xgettext_cmd() {
|
|
echo "--- start command ---"
|
|
|
|
cd "$PLUGIN_IN" || exit 1
|
|
|
|
# shellcheck disable=SC2046 disable=SC2086
|
|
xgettext-go \
|
|
-o "$PLUGIN_OUT" \
|
|
--keyword="$PLUGIN_KEYWORD" \
|
|
--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
|