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.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user