Skip to content

Commit

Permalink
[LOCAL] postfix timestamp to bust yarn cache
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 authored and Luna Wei committed Sep 9, 2021
1 parent d552362 commit 0d7586c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/test-manual-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,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"

Expand All @@ -116,7 +119,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}"
Expand Down

0 comments on commit 0d7586c

Please sign in to comment.