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

24 lines
647 B
JavaScript
Raw Permalink Normal View History

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'));