From ca3d273729a3f9a4c6f800dfeb31f0d1e9a41d20 Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Sat, 3 Aug 2024 13:01:03 +0200 Subject: [PATCH] [tools] generate_localizations.sh can be run from any directory Before this fix, it worked only if run from the repo root Signed-off-by: Alexander Borsuk --- tools/unix/generate_localizations.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/unix/generate_localizations.sh b/tools/unix/generate_localizations.sh index 28ff62c3c1..f5cdd32e60 100755 --- a/tools/unix/generate_localizations.sh +++ b/tools/unix/generate_localizations.sh @@ -19,9 +19,9 @@ case $OSTYPE in fi ;; esac -OMIM_PATH="$(dirname "$0")/../.." -TWINE_SUBMODULE=tools/twine -TWINE_PATH="$OMIM_PATH/$TWINE_SUBMODULE" +THIS_SCRIPT_PATH=$(cd "$(dirname "$0")"; pwd -P) +OMIM_PATH="$THIS_SCRIPT_PATH/../.." +TWINE_PATH="$OMIM_PATH/tools/twine" if [ ! -e "$TWINE_PATH/twine" ]; then echo "You need to have twine submodule present to run this script" @@ -29,7 +29,7 @@ if [ ! -e "$TWINE_PATH/twine" ]; then exit 1 fi -TWINE_COMMIT="$(git -C $TWINE_SUBMODULE rev-parse HEAD)" +TWINE_COMMIT="$(git -C $TWINE_PATH rev-parse HEAD)" TWINE_GEM="twine-$TWINE_COMMIT.gem" if [ ! -f "$TWINE_PATH/$TWINE_GEM" ]; then