@@ -26,39 +26,32 @@ struct GraphQLGeneratorCommand: ParsableCommand {
2626 print ( " Output directory: \( outputDirectory) " )
2727 }
2828
29- // Validate input files exist
3029 for filePath in schemaFiles {
3130 let fileURL = URL ( fileURLWithPath: filePath)
3231 guard FileManager . default. fileExists ( atPath: fileURL. path) else {
3332 throw ValidationError ( " Schema file not found: \( filePath) " )
3433 }
3534 }
3635
37- // Create output directory if it doesn't exist
3836 let outputURL = URL ( fileURLWithPath: outputDirectory)
3937 try FileManager . default. createDirectory ( at: outputURL, withIntermediateDirectories: true )
4038
4139 if verbose {
4240 print ( " Parsing schema files... " )
4341 }
44-
45- /// Read GraphQL schema files and combine them into a single schema
4642 var combinedSource = " "
4743 for filePath in schemaFiles {
4844 let url = URL ( fileURLWithPath: filePath)
4945 let content = try String ( contentsOf: url, encoding: . utf8)
5046 combinedSource += content + " \n "
5147 }
5248
53- // Generate code
5449 let generator = CodeGenerator ( )
5550 let files = try generator. generate ( source: combinedSource)
5651
57- // Write generated files
5852 for (filename, content) in files {
5953 let fileURL = outputURL. appendingPathComponent ( filename)
6054 try content. write ( to: fileURL, atomically: true , encoding: . utf8)
61-
6255 if verbose {
6356 print ( " Generated: \( fileURL. path) " )
6457 }
0 commit comments