fix ozone-web patch
This commit is contained in:
35
install.zsh
35
install.zsh
@@ -334,6 +334,41 @@ export const SOCIAL_APP_DOMAIN =\
|
|||||||
}' lib/constants.ts 2>/dev/null || true
|
}' lib/constants.ts 2>/dev/null || true
|
||||||
# Fix parseInt() to handle undefined by adding || ''
|
# Fix parseInt() to handle undefined by adding || ''
|
||||||
sediment "s/parseInt(env('\([^']*\)'))/parseInt(env('\1') || '0')/g" lib/constants.ts 2>/dev/null || true
|
sediment "s/parseInt(env('\([^']*\)'))/parseInt(env('\1') || '0')/g" lib/constants.ts 2>/dev/null || true
|
||||||
|
|
||||||
|
# Add next-runtime-env to package.json if missing (used by lib/constants.ts)
|
||||||
|
if ! grep -q 'next-runtime-env' package.json 2>/dev/null; then
|
||||||
|
echo "📦 Adding next-runtime-env to package.json..."
|
||||||
|
python3 -c "
|
||||||
|
import json
|
||||||
|
with open('package.json') as f:
|
||||||
|
d = json.load(f)
|
||||||
|
d.setdefault('dependencies', {})['next-runtime-env'] = '^1.6.2'
|
||||||
|
with open('package.json', 'w') as f:
|
||||||
|
json.dump(d, f, indent=2)
|
||||||
|
f.write('\n')
|
||||||
|
"
|
||||||
|
echo "✅ Added next-runtime-env"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Update @atproto/ozone in service/package.json to latest
|
||||||
|
echo "📦 Updating @atproto/ozone in service/package.json..."
|
||||||
|
local latest_ozone_ver
|
||||||
|
latest_ozone_ver=$(npm view @atproto/ozone version 2>/dev/null)
|
||||||
|
if [ -n "$latest_ozone_ver" ] && [ -f service/package.json ]; then
|
||||||
|
python3 -c "
|
||||||
|
import json, sys
|
||||||
|
ver = sys.argv[1]
|
||||||
|
with open('service/package.json') as f:
|
||||||
|
d = json.load(f)
|
||||||
|
old = d.get('dependencies', {}).get('@atproto/ozone', '')
|
||||||
|
d.setdefault('dependencies', {})['@atproto/ozone'] = ver
|
||||||
|
with open('service/package.json', 'w') as f:
|
||||||
|
json.dump(d, f, indent=2)
|
||||||
|
f.write('\n')
|
||||||
|
print(f'✅ @atproto/ozone: {old} -> {ver}')
|
||||||
|
" "$latest_ozone_ver"
|
||||||
|
fi
|
||||||
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user