Skip to content

Commit

Permalink
[tools][gettext] Fix relative path in mo output files generation
Browse files Browse the repository at this point in the history
Working directory change in script so the relative path is not correct
anymore.
Compute absolute mo path where gen_catalog.sh is launched.
  • Loading branch information
mengtan committed Apr 8, 2024
1 parent 4fd26d7 commit 45304de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/i18n/gen_catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ for a in "$@"; do
fi
done

if [[ ${1:-} = c* && -n ${2:-} ]]; then
mo_dir_base="$(realpath -m "$2")"
fi

cd "$(dirname "$0")/../.."

Expand Down Expand Up @@ -68,9 +71,9 @@ c|compile) # mo_dir ([<locale>] | 'all')
}

if (( $# == 3 )) && [[ $3 == 'all' ]] || (( $# == 2 )) ; then
each_locale compile "$2"
each_locale compile "$mo_dir_base"
elif (( $# == 3 )); then
compile "$3" "$2"
compile "$3" "$mo_dir_base"
else
usage_and_exit
fi
Expand Down

0 comments on commit 45304de

Please sign in to comment.