Skip to content

Commit

Permalink
chore: replace fs+promisify with fs/promises (#33599)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-lehnen-rc authored Oct 16, 2024
1 parent e14fa89 commit 3abc1e5
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions scripts/fossify.ts
Original file line number Diff line number Diff line change
@@ -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 };

Expand All @@ -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.');
};
Expand Down

0 comments on commit 3abc1e5

Please sign in to comment.