@@ -113,7 +113,47 @@ if [ -d repos ]; then
113113fi
114114
115115# Download Mynewt OS into the current project folder, under "repos" subfolder.
116- newt install -v -f
116+ set +e # TODO: Remove this when newt install is fixed
117+ newt install -v -f # TODO: "git checkout" fails due to uncommitted files
118+ set -e # TODO: Remove this when newt install is fixed
119+
120+ # If you see "Error: Unknown subcommand: get-url"
121+ # then upgrade git as shown above.
122+
123+ echo " ***** Reparing mynewt..."
124+
125+ # TODO: newt install fails due to uncommitted files. Need to check out manually.
126+
127+ # Check out core
128+ if [ -d repos/apache-mynewt-core ]; then
129+ pushd repos/apache-mynewt-core
130+ git checkout $mynewt_version -f
131+ popd
132+ fi
133+ # Check out nimble
134+ if [ -d repos/apache-mynewt-nimble ]; then
135+ pushd repos/apache-mynewt-nimble
136+ git checkout $nimble_version -f
137+ popd
138+ fi
139+ # Check out mcuboot
140+ if [ -d repos/mcuboot ]; then
141+ pushd repos/mcuboot
142+ git checkout $mcuboot_version -f
143+ popd
144+ fi
145+
146+ # If apache-mynewt-core is missing, then the installation failed.
147+ if [ ! -d repos/apache-mynewt-core ]; then
148+ echo " ***** newt install failed"
149+ exit 1
150+ fi
151+
152+ # If apache-mynewt-nimble is missing, then the installation failed.
153+ if [ ! -d repos/apache-mynewt-nimble ]; then
154+ echo " ***** newt install failed"
155+ exit 1
156+ fi
117157
118158set +x # Stop echoing all commands.
119159echo ✅ ◾ ️Done! See README.md for Mynewt type conversion build fixes. Please restart Visual Studio Code to activate the extensions
0 commit comments