Skip to content

Commit

Permalink
Merge pull request #6715 from wordpress-mobile/fix/used-strings-absol…
Browse files Browse the repository at this point in the history
…ute-path

build: Fix failure when running npm command `i18n:update`
  • Loading branch information
fluiddot authored Mar 11, 2024
2 parents 0e34f94 + 3edfdd4 commit e8ca8ee
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/i18n-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ function fetch_translations() {

# Set target path
if [[ -n "${LOCAL_PATH:-}" ]]; then
TARGET_PATH=$LOCAL_PATH
# Ensure the target path is an absolute path
# Use greadlink on macOS, readlink on Linux
if [[ "$(uname)" == "Darwin" ]]; then
TARGET_PATH=$(greadlink -f "$LOCAL_PATH")
else
TARGET_PATH=$(readlink -f "$LOCAL_PATH")
fi
else
TARGET_PATH=$(mktemp -d)
trap '{ rm -rf -- "$TARGET_PATH"; }' EXIT
Expand Down Expand Up @@ -138,7 +144,7 @@ for (( index=0; index<${#PLUGINS[@]}; index+=3 )); do
PLUGINS_WITH_ADAPTED_PATHS+=( "$PLUGIN_NAME" "$PROJECT_SLUG" "$ADJUSTED_PLUGIN_FOLDER" )
done
pushd gutenberg/packages/react-native-editor > /dev/null
METRO_CONFIG="../../../metro.config.js" node bin/extract-used-strings "../../../$USED_STRINGS_PATH" "${PLUGINS_WITH_ADAPTED_PATHS[@]}"
METRO_CONFIG="../../../metro.config.js" node bin/extract-used-strings "$USED_STRINGS_PATH" "${PLUGINS_WITH_ADAPTED_PATHS[@]}"
popd > /dev/null

# Download translations of plugins (i.e. Jetpack)
Expand Down

0 comments on commit e8ca8ee

Please sign in to comment.