fix for main origin 575a5adbeff0b46390fb08901c7166649255204c

This commit is contained in:
gandc committed 2026-10-11 03:11:48 +03:00
1 parent 703bf076e2
commit eef54a61cc
11 files changed
+1008 -703

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import {spawnSync} from 'node:child_process';
import {readFileSync} from 'node:fs';
import {dirname, resolve} from 'node:path';
import {fileURLToPath} from 'node:url';
const patchDir = resolve(dirname(fileURLToPath(import.meta.url)), '../patches');
const source = resolve(process.argv[2] || 'fluxer-src');
const names = readFileSync(resolve(patchDir, 'series'), 'utf8').split(/\r?\n/).filter(Boolean);
if (!names.length) throw new Error('The patch series is empty');
const patches = names.map((name) => {
if (!/^[0-9]{4}-[a-z0-9-]+\.patch$/.test(name)) throw new Error(`Invalid patch name: ${name}`);
return resolve(patchDir, name);
});
function apply(...options) {
const result = spawnSync('git', ['-C', source, 'apply', '--whitespace=error-all', ...options, ...patches], {
stdio: 'inherit',
});
if (result.error) throw result.error;
if (result.status !== 0) throw new Error(`git apply ${options.join(' ')} failed (${result.status})`);
}
apply('--check');
if (!process.argv.includes('--check')) apply();
console.log(`Validated ${patches.length} GSCORD patches${process.argv.includes('--check') ? '' : ' and applied them'}.`);