@@ -2,7 +2,6 @@ const fs = require("fs");
22const path = require ( "path" ) ;
33const glob = require ( "glob" ) ;
44const process = require ( "process" ) ;
5- const { log } = require ( "console" ) ;
65
76const findDirectoryPath = ( targetDirectoryName ) => {
87 const pathToCheck = path . join ( process . cwd ( ) , targetDirectoryName ) ;
@@ -16,6 +15,10 @@ const findDirectoryPath = (targetDirectoryName) => {
1615 path : path . join ( pathToCheck , folder . name ) ,
1716 } ) ) ;
1817 const rpcDirectory = path . join ( folders [ 0 ] . path , "rpc" ) ;
18+
19+ console . log ( "rpcDirectory" , rpcDirectory ) ;
20+ console . log ( "folders[0].name" , folders [ 0 ] . name ) ;
21+
1922 return [ rpcDirectory , folders [ 0 ] . name ] ;
2023} ;
2124
@@ -33,13 +36,21 @@ function return_json_schema(directoryPath, folder_path, project_name) {
3336 } ) ) ;
3437 var folders_schemas = { } ;
3538 folders . forEach ( ( folder ) => {
39+ console . log ( "folder" , folder ) ;
3640 if ( folder . name == "schemas" ) {
37- const jsonFiles = glob . sync ( path . join ( folder . path , "**/*.json" ) ) ;
41+ console . log ( "schemas" ) ;
42+ console . log ( "folder.path" , folder . path ) ;
43+ console . log ( "test" , path . join ( folder . path , "/*.json" ) ) ;
44+ var jsonFiles = glob . sync ( path . join ( folder . path , "/*.json" ) ) ;
45+ console . log ( "jsonFiles" , jsonFiles ) ;
3846 var schemas = { } ;
47+
3948 jsonFiles . forEach ( ( filePath ) => {
49+ console . log ( "filePath" , filePath ) ;
4050 try {
4151 const fileContent = fs . readFileSync ( filePath , "utf8" ) ;
4252 var jsonData = JSON . parse ( fileContent ) ;
53+ console . log ( "jsonData" , jsonData ) ;
4354 var filename = filePath
4455 . replace ( / ^ .* [ \\ / ] / , "" )
4556 . replace ( / \. [ ^ / . ] + $ / , "" ) ;
0 commit comments