0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00
logto/.scripts/update-parcelrc.js

23 lines
647 B
JavaScript

import { execSync } from 'child_process';
import path from 'path';
import fs from 'fs/promises';
if (!process.arch.startsWith('arm')) {
process.exit(0);
}
execSync('rm packages/**/.parcelrc');
const updateParcelRcArm64 = async (dir) => {
const dirents = await fs.readdir(dir, { withFileTypes: true });
for (const dirent of dirents) {
if (dirent.isDirectory()) {
await updateParcelRcArm64(path.resolve(dir, dirent.name));
} else if (dirent.name === '.parcelrc.arm64') {
await fs.rename(path.resolve(dir, dirent.name), path.resolve(dir, '.parcelrc'));
}
}
};
await updateParcelRcArm64(path.resolve('packages'));