Skip to content

Commit

Permalink
improve compile script
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 30, 2024
1 parent 570b558 commit 907a9c5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: translate project
run: |
./tx pull -a
docker compose run qgis sh -c 'xvfb-run /usr/src/scripts/project-translation-compile.sh'
docker compose run qgis sh -c 'xvfb-run /usr/src/scripts/project-translation-compile.sh /usr/src/project'
rm project/signalo_*.ts # do not package ts files
- name: set project version + create project archive
Expand Down
26 changes: 25 additions & 1 deletion scripts/project-translation-compile.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
#!/usr/bin/env bash

for f in /usr/src/project/*\_*.ts
set -e

PROJECT=$1

if [[ -z ${PROJECT} ]]; then
echo "Script takes the QGIS project path or its directory as argument"
exit 1
fi

PATH=$(dirname ${PROJECT})

echo $PATH

if [[ ! -d ${PATH} ]]; then
echo "'${PATH}' directory does not exist"
exit 1
fi

FOUND=0
for f in ${PATH}/*\_*.ts
do
FOUND=1
lrelease $f ${f%.ts}.qm
done

if [[ ${FOUND} -eq 0 ]]; then
echo "No TS file found in '${PATH}'"
fi

0 comments on commit 907a9c5

Please sign in to comment.