pr feedback

This commit is contained in:
Ari Lazier 2015-12-16 18:14:14 -08:00
parent 4c402a7daf
commit de227cff28
2 changed files with 6 additions and 23 deletions

View File

@ -1,21 +0,0 @@
set -o pipefail
DIRECTORY=${1:-"."}
if [ ! -f "${DIRECTORY}/package.json" ]; then
echo "No package.json in ${DIRECTORY}"
exit 1
fi
VERSION=`cat ${DIRECTORY}/package.json | awk '/"react-native": "(.+)",/ { print substr($2, 2, length($2)-3) }'`
if [ -f "${DIRECTORY}/node_modules/react-native/package.json" ]; then
CURRENT_VERSION=`cat ${DIRECTORY}/node_modules/react-native/package.json | awk '/"version": "(.+)",/ { print substr($2, 2, length($2)-3) }'`
fi
pushd $DIRECTORY
if [ "$VERSION" != "$CURRENT_VERSION" ]; then
echo "Upgrading react-native to version $VERSION"
npm install react-native
fi
popd

View File

@ -9,6 +9,8 @@ while pgrep -q Simulator; do
pkill -9 Simulator 2>/dev/null || true
done
pkill node || true
DESTINATION="-destination id=$(xcrun simctl list devices | grep -v unavailable | grep -m 1 -o '[0-9A-F\-]\{36\}')"
TARGET=$1
CONFIGURATION=${2:-"Debug"}
@ -20,7 +22,7 @@ elif [ "$TARGET" = "react-tests" ]; then
if [ -f ../../target=node_modules/react_tests_node_modules.zip ]; then
unzip ../../target=node_modules/react_tests_node_modules.zip
fi
sh ../../scripts/npm_install_react_native.sh
npm update react-native
react-native start &
popd
@ -30,10 +32,12 @@ elif [ "$TARGET" = "react-example" ]; then
if [ -f ../../target=node_modules/react_example_node_modules.zip ]; then
unzip ../../target=node_modules/react_example_node_modules.zip
fi
sh ../../scripts/npm_install_react_native.sh
npm update react-native
react-native start &
xcodebuild -scheme ReactExample -configuration "$CONFIGURATION" -sdk iphonesimulator build $DESTINATION
popd
else
echo "Invalid target '${TARGET}'"
fi
pkill node || true