| #!/usr/bin/env node |
| |
| |
| |
| |
|
|
| const fs = require('fs'); |
| const path = require('path'); |
|
|
| const EXT_DIR = path.join(__dirname, '../artifacts/fb-publisher/public/extension'); |
| const MANIFEST_PATH = path.join(EXT_DIR, 'manifest.json'); |
|
|
| const newVersion = process.argv[2]; |
|
|
| if (!newVersion) { |
| console.error('❌ يرجى تحديد رقم الإصدار. مثال: pnpm run update-ext-version 1.6.0'); |
| process.exit(1); |
| } |
|
|
| if (!/^\d+\.\d+\.\d+$/.test(newVersion)) { |
| console.error('❌ صيغة الإصدار غير صحيحة. يجب أن تكون بالشكل: 1.6.0'); |
| process.exit(1); |
| } |
|
|
| const manifest = JSON.parse(fs.readFileSync(MANIFEST_PATH, 'utf8')); |
| const oldVersion = manifest.version; |
| manifest.version = newVersion; |
| fs.writeFileSync(MANIFEST_PATH, JSON.stringify(manifest, null, 2) + '\n', 'utf8'); |
|
|
| console.log(`✅ تم تحديث الإصدار: ${oldVersion} → ${newVersion}`); |
| console.log('🔄 جاري إعادة بناء ZIP...\n'); |
|
|
| require('./obfuscate-extension.cjs'); |
|
|