Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tools): nvm support added so node is correctly resolved #535

Merged
merged 8 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions AmplifyTools/amplify-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@
#
# SPDX-License-Identifier: Apache-2.0

set -e

if ! which node >/dev/null; then
echo "warning: Node is not installed. Visit https://nodejs.org/en/download/ to install it"
exit 1
fi

# Check for NVM and make sure it's initialized
NVM_PATH="${HOME}/.nvm/nvm.sh"
if [ -f "${NVM_PATH}" ]; then
echo "NVM found, initializing it..."
source "${NVM_PATH}"
fi

set -e

Comment on lines +21 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should have caught this before....

set -e should probably come before export PATH=$PATH:$(npm bin -g) in case npm bin fails.

export PATH=$PATH:$(npm bin -g)

# Note the use of tail -1 is important here because when upgrading between versions
Expand Down Expand Up @@ -172,4 +180,4 @@ if $amplifyPush; then
else
amplify init --amplify $AMPLIFY --providers $PROVIDERS --yes
fi
fi
fi
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. See [standa
### Bug Fixes

* **DataStore:** Fixed a DataStore issue where lazy `List<M>` initialization would fail for relationships 3+ levels deep ([#534](https://github.com/aws-amplify/amplify-ios/pull/534))
* **Tools:** Update Amplify tools script to resolve node correctly when NVM is installed ([#524](https://github.com/aws-amplify/amplify-ios/pull/524))

## 1.0.1 (2020-06-05)

Expand Down