sed -i.bak -E "s/(\"version\":[[:space:]]*\").+(\")/\"version\": \"${RELEASE}.0-rc\"/g""package.json"|| error "Couldn't update version for npm"
sed -i.bak -E "s/(s.version[[:space:]]{13}=[[:space:]].+)/s.version = \"${RELEASE}.0-rc\"/g""React.podspec"|| error "Couldn't update version for CocoaPods"
sed -i.bak -E "s/\"com\.facebook\.react:react-native:.+\"/\"com.facebook.react:react-native:${RELEASE}.+\"/g""local-cli/generator-android/templates/src/app/build.gradle"|| error "Couldn't update version in Android template's build.gradle"
success "Updated version numbers"
npm_registry="http://localhost:4873/"
npm set registry "${npm_registry}"&&[[$(npm config list | grep registry)=="registry = \"${npm_registry}\""]]|| error "Couldn't set registry to ${npm_registry}"
info "npm registry set. Run 'sinopia' in a new Terminal"
info " - Make sure it prints 'http address - ${npm_registry}'"
info " - Make sure ${npm_registry} shows no old versions"
grep "\"react-native\": \"\^${RELEASE}.0-rc\"""/tmp/${project_name}/package.json"|| error "Incorrect version number in /tmp/${project_name}/package.json"
grep "com.facebook.react:react-native:${RELEASE}.+""${project_name}/android/app/build.gradle"|| error "Incorrect version number in /tmp/${project_name}/android/app/build.gradle"
success "New sample project generated at /tmp/${project_name}"
info "Test the following both on Android and iOS:"
info " - Verify that packager opens in new Window"
info " - Verify that you see the 'Welcome to React Native' screen"