Skip to content

Commit

Permalink
update asdf-vm setup to use $ASDF_DIR to work if user defined cus…
Browse files Browse the repository at this point in the history
…tom directory (#36043)

Summary:
Update setup of sourcing `asdf-vm` in `find-node-for-xcode.sh` in case of user has custom defined of `$ASDF_DIR`
by default `$ASDF_DIR` point to `$HOME/.asdf`, but if user has custom directory (like XDG convention) this script wont work without this change.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [CHANGED] - Find node binary when using asdf as the node version manager with custom `$ASDF_DIR`

Pull Request resolved: #36043

Test Plan: use a defualt/custom `$ASDF_DIR` while using `asdf-vm` as node version manager then make iOS build.

Reviewed By: cortinico

Differential Revision: D42990407

Pulled By: cipolleschi

fbshipit-source-id: 1fe3fdc786bddf741ff422e7bec55a6c9cc8ed83
  • Loading branch information
MuhmdRaouf authored and facebook-github-bot committed Feb 7, 2023
1 parent 0a4dcb0 commit f6a4e4f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/find-node-for-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ if [[ ! -x node && -d ${HOME}/.anyenv/bin ]]; then
fi

# Set up asdf-vm if present
if [[ -f "$HOME/.asdf/asdf.sh" ]]; then
if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
# shellcheck source=/dev/null
. "$ASDF_DIR/asdf.sh"
elif [[ -f "$HOME/.asdf/asdf.sh" ]]; then
# shellcheck source=/dev/null
. "$HOME/.asdf/asdf.sh"
elif [[ -x "$(command -v brew)" && -f "$(brew --prefix asdf)/asdf.sh" ]]; then
Expand Down

0 comments on commit f6a4e4f

Please sign in to comment.