Skip to content

Commit

Permalink
Add volta support to find-node.sh (#32611)
Browse files Browse the repository at this point in the history
Summary:
This PR add [volta](https://volta.sh/) support to find-node.sh for use by `scripts/react-native-xcode.sh`, `scripts/generate-specs.sh`, etc.

## Changelog

[iOS] [Added] - add volta support to find-node.sh

Pull Request resolved: #32611

Test Plan:
Manually tested with volta installed node (and [relevant change](https://docs.volta.sh/guide/understanding#managing-your-project) added to the project's package.json). Without this patch, the `Bundle React Native code and images` Build Phase fails, with it, it succeeds.

Tested with both `curl https://get.volta.sh | bash` installed and `brew install volta`. One check works for both because the `node` shim will always be installed to the same location (and the required environment variable exports are the same also)

Wasn't sure if you'd want the package.json change applied to rn-tester? Shouldn't affect people who don't use volta. Shout if you want me to add it to this PR.

Reviewed By: cortinico

Differential Revision: D32498267

Pulled By: yungsters

fbshipit-source-id: 93ee187bd2178bfcd8f9009a1a0668c6f5583aa3
  • Loading branch information
liamjones authored and facebook-github-bot committed Nov 19, 2021
1 parent 6b1ccef commit 7658440
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/find-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ elif [[ -x "$(command -v brew)" && -f "$(brew --prefix asdf)/asdf.sh" ]]; then
# shellcheck source=/dev/null
. "$(brew --prefix asdf)/asdf.sh"
fi

# Set up volta if present
if [[ -x "$HOME/.volta/bin/node" ]]; then
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
fi

0 comments on commit 7658440

Please sign in to comment.