| |
@@ -1,7 +1,39 @@
|
| |
#!/usr/bin/env bash
|
| |
- #pybabel extract -F ../babel.cfg -o getfedora.org.pot . ../partials/
|
| |
- pybabel extract -F ../../babel.cfg -o getfedora.org.pot ../../partials ../../getfedora.org/site ../../getfedora.org/partials
|
| |
+ CONFIGFILE=babel.cfg
|
| |
+ COMMAND=(pybabel extract -F babel.cfg -o getfedora.org.pot partials getfedora.org/site getfedora.org/partials)
|
| |
+ # Command needs to be run from the directory containing babel.cfg for the proper output format
|
| |
+ if test -f "$CONFIGFILE"; then
|
| |
+ # Run the command given above
|
| |
+ "${COMMAND[@]}"
|
| |
+ else
|
| |
+ # if running with "podman run " move to the directory containing babel.cfg
|
| |
+ if test -f "../$CONFIGFILE"; then
|
| |
+ cd ..
|
| |
+ "${COMMAND[@]}"
|
| |
+ # if running from the scripts directory move to the directory containing babel.cfg
|
| |
+ elif test -f "../../$CONFIGFILE"; then
|
| |
+ cd ../..
|
| |
+ "${COMMAND[@]}"
|
| |
+ # script is called from some other location than the supported ones.
|
| |
+ else
|
| |
+ echo
|
| |
+ echo " SCRIPT EXECUTION FAILED!"
|
| |
+ echo
|
| |
+ echo " No $CONFIGFILE found."
|
| |
+ echo
|
| |
+ echo " This script should be run from the directory containing $CONFIGFILE by running"
|
| |
+ echo " ./getfedora.org/scripts/translations-source.sh"
|
| |
+ echo " Alternatively it can be run from the scripts directory by running"
|
| |
+ echo " ./translations-source.sh"
|
| |
+ echo
|
| |
+ echo
|
| |
+ exit 1
|
| |
+ fi
|
| |
+ fi
|
| |
echo
|
| |
echo
|
| |
+ echo 'Note: Instructions below has not been tested due to missing access rights'
|
| |
echo 'If you have write access to https://pagure.io/fedora-web/translations, you may now run:'
|
| |
- echo './scripts/push-pot.sh'
|
| |
+ echo '.getfedora.org/scripts/push-pot.sh'
|
| |
+ echo
|
| |
+
|
| |
The build pipeline expects to find the pot file at the same location as the translations-source.sh and push-pot.sh scripts or it will fail.