[LOCAL] postfix timestamp to bust yarn cache

This commit is contained in:
Tommy Nguyen
2021-06-08 16:47:56 +02:00
parent 5c8c5b6cf5
commit cae0637986
+5 -2
View File
@@ -78,9 +78,12 @@ lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill
npm pack
PACKAGE=$(pwd)/react-native-$PACKAGE_VERSION.tgz
TIMESTAMP=$(date +%s)
PACKAGE=$(pwd)/react-native-$PACKAGE_VERSION-$TIMESTAMP.tgz
success "Package bundled ($PACKAGE)"
mv "$(pwd)/react-native-$PACKAGE_VERSION.tgz" "$PACKAGE"
node scripts/set-rn-template-version.js "file:$PACKAGE"
success "React Native version changed in the template"
@@ -91,7 +94,7 @@ rm -rf "$project_name"
node "$repo_root/cli.js" init "$project_name" --template "$repo_root"
info "Double checking the versions in package.json are correct:"
grep "\"react-native\": \".*react-native-$PACKAGE_VERSION.tgz\"" "/tmp/${project_name}/package.json" || error "Incorrect version number in /tmp/${project_name}/package.json"
grep "\"react-native\": \".*react-native-$PACKAGE_VERSION-$TIMESTAMP.tgz\"" "/tmp/${project_name}/package.json" || error "Incorrect version number in /tmp/${project_name}/package.json"
grep -E "com.facebook.react:react-native:\\+" "${project_name}/android/app/build.gradle" || error "Dependency in /tmp/${project_name}/android/app/build.gradle must be com.facebook.react:react-native:+"
success "New sample project generated at /tmp/${project_name}"