Browse Source

contrib: fix build_locale.sh to work with relative paths

I think all scripts that call this file already used abs paths,
but manual callers tend to use relative paths.
master
SomberNight 3 years ago
parent
commit
fa04ff005b
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 10
      contrib/build_locale.sh

10
contrib/build_locale.sh

@ -8,16 +8,20 @@ if [[ ! -d "$1" || -z "$2" ]]; then
exit 1 exit 1
fi fi
# convert $1 and $2 to abs paths
SRC_DIR="$(realpath "$1" 2> /dev/null || grealpath "$1")"
DST_DIR="$(realpath "$2" 2> /dev/null || grealpath "$2")"
if ! which msgfmt > /dev/null 2>&1; then if ! which msgfmt > /dev/null 2>&1; then
echo "Please install gettext" echo "Please install gettext"
exit 1 exit 1
fi fi
cd "$1" cd "$SRC_DIR"
mkdir -p "$2" mkdir -p "$DST_DIR"
for i in *; do for i in *; do
dir="$2/$i/LC_MESSAGES" dir="$DST_DIR/$i/LC_MESSAGES"
mkdir -p "$dir" mkdir -p "$dir"
(msgfmt --output-file="$dir/electrum.mo" "$i/electrum.po" || true) (msgfmt --output-file="$dir/electrum.mo" "$i/electrum.po" || true)
done done

Loading…
Cancel
Save