Skip to content

Commit 2b6972b

Browse files
authored
fix(tools): nvm support added so node is correctly resolved (#535)
1 parent 7b5611b commit 2b6972b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

AmplifyTools/amplify-tools.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@
55
#
66
# SPDX-License-Identifier: Apache-2.0
77

8-
set -e
98

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

14+
# Check for NVM and make sure it's initialized
15+
NVM_PATH="${HOME}/.nvm/nvm.sh"
16+
if [ -f "${NVM_PATH}" ]; then
17+
echo "NVM found, initializing it..."
18+
source "${NVM_PATH}"
19+
fi
20+
21+
set -e
22+
1523
export PATH=$PATH:$(npm bin -g)
1624

1725
# Note the use of tail -1 is important here because when upgrading between versions
@@ -172,4 +180,4 @@ if $amplifyPush; then
172180
else
173181
amplify init --amplify $AMPLIFY --providers $PROVIDERS --yes
174182
fi
175-
fi
183+
fi

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. See [standa
77
### Bug Fixes
88

99
* **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))
10+
* **Tools:** Update Amplify tools script to resolve node correctly when NVM is installed ([#524](https://github.com/aws-amplify/amplify-ios/pull/524))
1011

1112
## 1.0.1 (2020-06-05)
1213

0 commit comments

Comments
 (0)