chore: replace fs+promisify with fs/promises (#33599)
Some checks are pending
Deploy GitHub Pages / deploy-preview (push) Waiting to run
CI / ⚙️ Variables Setup (push) Waiting to run
CI / 🚀 Notify external services - draft (push) Blocked by required conditions
CI / 📦 Build Packages (push) Blocked by required conditions
CI / deploy-preview (push) Blocked by required conditions
CI / 📦 Meteor Build - coverage (push) Blocked by required conditions
CI / 📦 Meteor Build - official (push) Blocked by required conditions
CI / 🚢 Build Docker Images for Testing (alpine) (push) Blocked by required conditions
CI / 🚢 Build Docker Images for Testing (official) (push) Blocked by required conditions
CI / 🚢 Build Docker Images for Production (alpine) (push) Blocked by required conditions
CI / 🚢 Build Docker Images for Production (official) (push) Blocked by required conditions
CI / 🔎 Code Check (push) Blocked by required conditions
CI / 🔨 Test Unit (push) Blocked by required conditions
CI / 🔨 Test API (CE) (push) Blocked by required conditions
CI / 🔨 Test UI (CE) (push) Blocked by required conditions
CI / 🔨 Test API (EE) (push) Blocked by required conditions
CI / 🔨 Test UI (EE) (push) Blocked by required conditions
CI / ✅ Tests Done (push) Blocked by required conditions
CI / 🚀 Publish build assets (push) Blocked by required conditions
CI / 🚢 Build Docker Image (preview) (push) Blocked by required conditions
CI / 🚀 Publish Docker Image (main) (alpine) (push) Blocked by required conditions
CI / 🚀 Publish Docker Image (main) (official) (push) Blocked by required conditions
CI / 🚀 Publish Docker Image (main) (preview) (push) Blocked by required conditions
CI / 🚀 Publish Docker Image (services) (account) (push) Blocked by required conditions
CI / 🚀 Publish Docker Image (services) (authorization) (push) Blocked by required conditions
CI / 🚀 Publish Docker Image (services) (ddp-streamer) (push) Blocked by required conditions
CI / 🚀 Publish Docker Image (services) (omnichannel-transcript) (push) Blocked by required conditions
CI / 🚀 Publish Docker Image (services) (presence) (push) Blocked by required conditions
CI / 🚀 Publish Docker Image (services) (queue-worker) (push) Blocked by required conditions
CI / 🚀 Publish Docker Image (services) (stream-hub) (push) Blocked by required conditions
CI / 🚀 Notify external services (push) Blocked by required conditions
CI / trigger-dependent-workflows (push) Blocked by required conditions
CI / Update Version Durability (push) Blocked by required conditions
Code scanning - action / CodeQL-Build (push) Waiting to run

This commit is contained in:
Pierre Lehnen 2024-10-15 23:51:53 -03:00 committed by GitHub
parent e14fa89450
commit 3abc1e5929
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,10 +1,5 @@
import readline from 'readline';
import fs from 'fs';
import { promisify } from 'util';
const rmdir = promisify(fs.rmdir);
const unlink = promisify(fs.unlink);
const rename = promisify(fs.rename);
import fs from 'fs/promises';
const removeOptions = { maxRetries: 3, recursive: true };
@ -15,15 +10,15 @@ const rl = readline.createInterface({
const fossify = async () => {
console.log('Removing Premium Apps and Packages...');
await rmdir('./ee', removeOptions);
await fs.rmdir('./ee', removeOptions);
console.log('Removing Premium code in the main app...');
await rmdir('./apps/meteor/ee', removeOptions);
await fs.rmdir('./apps/meteor/ee', removeOptions);
console.log('Replacing main files...');
await unlink('./apps/meteor/server/ee.ts');
await fs.unlink('./apps/meteor/server/ee.ts');
await rename('./apps/meteor/server/foss.ts', './apps/meteor/server/ee.ts');
await fs.rename('./apps/meteor/server/foss.ts', './apps/meteor/server/ee.ts');
console.log('Done.');
};