MCPcopy Index your code
hub / github.com/awesome-opencode/awesome-opencode / main

Function main

scripts/validate.js:64–107  ·  view source on GitHub ↗

* Main validation function

()

Source from the content-addressed store, hash-verified

62 * Main validation function
63 */
64function main() {
65 const args = process.argv.slice(2);
66 let files = [];
67
68 if (args.length > 0) {
69 // Validate specified files
70 files = args;
71 } else {
72 // Validate all YAML files in data/
73 files = getAllYamlFiles();
74 }
75
76 if (files.length === 0) {
77 console.log('No YAML files to validate.');
78 process.exit(0);
79 }
80
81 console.log(`Validating ${files.length} YAML file(s)...\n`);
82
83 let allValid = true;
84 let validatedCount = 0;
85
86 for (const file of files) {
87 if (fs.existsSync(file)) {
88 if (!validateFile(file)) {
89 allValid = false;
90 }
91 validatedCount++;
92 } else {
93 console.warn(`⚠ File not found: ${file}`);
94 allValid = false;
95 }
96 }
97
98 console.log('');
99
100 if (allValid) {
101 console.log(`✓ All ${validatedCount} file(s) passed validation.`);
102 process.exit(0);
103 } else {
104 console.error(`✗ Validation failed for ${validatedCount} file(s).`);
105 process.exit(1);
106 }
107}
108
109main();

Callers 1

validate.jsFile · 0.70

Calls 2

getAllYamlFilesFunction · 0.85
validateFileFunction · 0.85

Tested by

no test coverage detected