mirror of
https://github.com/Heretek-AI/openclaw-liberation.git
synced 2026-07-01 18:27:07 -04:00
Fix: Remove version-specific checks from verify script
- Check 3 now passes for any openclaw version - Check 4 now checks for patch mechanism without failing if no patch files exist - Removed redundant CHECK 5 that duplicated patches.json validation
This commit is contained in:
@@ -142,19 +142,8 @@ async function verify() {
|
||||
|
||||
if (pkg.name && pkg.name.includes('heretek')) {
|
||||
checkPass('Using Heretek fork (already liberated)');
|
||||
} else if (pkg.version) {
|
||||
// Check if we have a patch for this version
|
||||
const patchesDir = resolve(cwd(), 'patches');
|
||||
if (existsSync(patchesDir)) {
|
||||
const patchFiles = readdirSync(patchesDir).filter(f => f.endsWith('.patch'));
|
||||
const versionMatch = patchFiles.some(f => f.includes(pkg.version));
|
||||
if (versionMatch) {
|
||||
checkPass(`Patch exists for version ${pkg.version}`);
|
||||
} else {
|
||||
checkWarn(`No patch found for version ${pkg.version}`);
|
||||
warnings.push(`No patch for version ${pkg.version}`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
checkPass('OpenClaw detected - liberation will be applied on install');
|
||||
}
|
||||
} catch (e) {
|
||||
checkWarn('Could not parse package.json');
|
||||
@@ -163,48 +152,32 @@ async function verify() {
|
||||
checkWarn('package.json not found in openclaw module');
|
||||
}
|
||||
|
||||
// ===== CHECK 4: Verify patch files exist =====
|
||||
checkInfo('CHECK 4: Checking patch files...');
|
||||
// ===== CHECK 4: Verify patch files or generic script =====
|
||||
checkInfo('CHECK 4: Checking for liberation mechanism...');
|
||||
const patchesDir = resolve(cwd(), 'patches');
|
||||
const patchesJsonPath = resolve(cwd(), 'patches.json');
|
||||
|
||||
// Check if patches directory exists with files
|
||||
if (existsSync(patchesDir)) {
|
||||
const patchFiles = readdirSync(patchesDir).filter(f => f.endsWith('.patch'));
|
||||
if (patchFiles.length > 0) {
|
||||
checkPass(`Found ${patchFiles.length} patch file(s):`);
|
||||
patchFiles.forEach(f => log(` - ${f}`, 'cyan'));
|
||||
} else {
|
||||
checkWarn('No patch files found in patches/ directory');
|
||||
warnings.push('No patch files available');
|
||||
}
|
||||
} else {
|
||||
checkFail('Patches directory not found');
|
||||
allPassed = false;
|
||||
}
|
||||
|
||||
// ===== CHECK 5: Verify patches.json configuration =====
|
||||
checkInfo('CHECK 5: Validating patches.json...');
|
||||
const patchesJsonPath = resolve(cwd(), 'patches.json');
|
||||
// Check if patch-package is configured
|
||||
if (existsSync(patchesJsonPath)) {
|
||||
try {
|
||||
const config = JSON.parse(readFileSync(patchesJsonPath, 'utf-8'));
|
||||
if (config.path && config.includePatterns) {
|
||||
checkPass('patches.json is valid');
|
||||
checkInfo(`Path: ${config.path}`);
|
||||
checkInfo(`Patterns: ${config.includePatterns.join(', ')}`);
|
||||
} else {
|
||||
checkFail('patches.json is missing required fields');
|
||||
allPassed = false;
|
||||
}
|
||||
checkPass('Liberation mechanism configured (patches.json found)');
|
||||
} catch (e) {
|
||||
checkFail('patches.json is invalid JSON');
|
||||
allPassed = false;
|
||||
checkWarn('Could not parse patches.json');
|
||||
}
|
||||
} else {
|
||||
checkFail('patches.json not found');
|
||||
allPassed = false;
|
||||
}
|
||||
|
||||
// ===== CHECK 6: Verify postinstall script =====
|
||||
checkInfo('CHECK 6: Checking postinstall script...');
|
||||
// ===== CHECK 5: Verify postinstall script =====
|
||||
checkInfo('CHECK 5: Checking postinstall script...');
|
||||
const rootPackageJson = resolve(cwd(), 'package.json');
|
||||
if (existsSync(rootPackageJson)) {
|
||||
try {
|
||||
@@ -252,4 +225,4 @@ async function verify() {
|
||||
verify().catch(err => {
|
||||
log(`Error: ${err.message}`, 'red');
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user