fix build option pkg version
This commit is contained in:
@@ -41,6 +41,22 @@ else
|
||||
fi
|
||||
|
||||
function cleanup_build {
|
||||
# 1.8. Update package.json version (prevent App Store version conflict)
|
||||
echo "1.8. Updating package.json version..."
|
||||
if [ -n "$APP_VERSION" ]; then
|
||||
PACKAGE_JSON="$REPO_DIR/package.json"
|
||||
# Use node to update version in package.json
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const pkg = JSON.parse(fs.readFileSync('$PACKAGE_JSON', 'utf8'));
|
||||
pkg.version = '$APP_VERSION';
|
||||
fs.writeFileSync('$PACKAGE_JSON', JSON.stringify(pkg, null, 2) + '\n');
|
||||
"
|
||||
echo " ✅ Set version to $APP_VERSION"
|
||||
else
|
||||
echo " ⚠️ APP_VERSION not set in .env"
|
||||
fi
|
||||
|
||||
# 2. Prebuild (Generate ios directory)
|
||||
echo "2. Running Expo Prebuild..."
|
||||
# Clean old ios folder to remove old entitlements/AppClip targets
|
||||
|
||||
@@ -34,6 +34,21 @@ else
|
||||
echo "⚠️ Warning: $ASSETS_DIR not found"
|
||||
fi
|
||||
|
||||
# 1.8. Update package.json version (prevent App Store version conflict)
|
||||
echo "1.8. Updating package.json version..."
|
||||
if [ -n "$APP_VERSION" ]; then
|
||||
PACKAGE_JSON="$REPO_DIR/package.json"
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const pkg = JSON.parse(fs.readFileSync('$PACKAGE_JSON', 'utf8'));
|
||||
pkg.version = '$APP_VERSION';
|
||||
fs.writeFileSync('$PACKAGE_JSON', JSON.stringify(pkg, null, 2) + '\n');
|
||||
"
|
||||
echo " ✅ Set version to $APP_VERSION"
|
||||
else
|
||||
echo " ⚠️ APP_VERSION not set in .env"
|
||||
fi
|
||||
|
||||
# 2. Prebuild (Generate ios directory)
|
||||
echo "2. Running Expo Prebuild..."
|
||||
# Clean old ios folder to remove old entitlements/AppClip targets
|
||||
|
||||
Reference in New Issue
Block a user