@@ -96,15 +96,28 @@ export class IdentitiesJsonformsService extends AbstractService {
9696 async generateAll ( ) : Promise < any > {
9797 const hardConfigPath = './src/management/identities/validations/_config' ;
9898 const dynamicConfigPath = './configs/identities/validations' ;
99- const hardConfigFiles = readdirSync ( hardConfigPath ) . map ( ( file ) => ( { schema : file , path : hardConfigPath } ) ) ;
100- const dynamicConfigFiles = readdirSync ( dynamicConfigPath ) . map ( ( file ) => ( {
101- schema : file ,
102- path : dynamicConfigPath ,
103- } ) ) ;
99+
100+ let hardConfigFiles = [ ] ;
101+ try {
102+ hardConfigFiles = readdirSync ( hardConfigPath ) . map ( ( file ) => ( { schema : file , path : hardConfigPath } ) ) ;
103+ } catch ( error ) {
104+ console . log ( `Error reading hard config files: ${ error . message } ` ) ;
105+ }
106+
107+ let dynamicConfigFiles = [ ] ;
108+ try {
109+ dynamicConfigFiles = readdirSync ( dynamicConfigPath ) . map ( ( file ) => ( {
110+ schema : file ,
111+ path : dynamicConfigPath ,
112+ } ) ) ;
113+ } catch ( error ) {
114+ console . log ( `Error reading dynamic config files: ${ error . message } ` ) ;
115+ }
104116
105117 console . log ( 'Generating jsonforms for all schemas' ) ;
106118 console . log ( 'Hard config files:' , hardConfigFiles ) ;
107119 console . log ( 'Dynamic config files:' , dynamicConfigFiles ) ;
120+
108121 const files = [ ...hardConfigFiles , ...dynamicConfigFiles ] . filter ( ( file ) => file . schema . endsWith ( '.yml' ) ) ;
109122 for ( const file of files ) {
110123 this . generate ( file ) ;
@@ -115,8 +128,20 @@ export class IdentitiesJsonformsService extends AbstractService {
115128 async findAll ( ) : Promise < any > {
116129 const hardConfigPath = './src/management/identities/jsonforms/_config' ;
117130 const dynamicConfigPath = './configs/identities/jsonforms' ;
118- const hardConfigFiles = readdirSync ( hardConfigPath ) . map ( ( file ) => ( { file, path : hardConfigPath } ) ) ;
119- const dynamicConfigFiles = readdirSync ( dynamicConfigPath ) . map ( ( file ) => ( { file, path : dynamicConfigPath } ) ) ;
131+
132+ let hardConfigFiles = [ ] ;
133+ try {
134+ hardConfigFiles = readdirSync ( hardConfigPath ) . map ( ( file ) => ( { file, path : hardConfigPath } ) ) ;
135+ } catch ( error ) {
136+ console . log ( `Error reading hard config files: ${ error . message } ` ) ;
137+ }
138+
139+ let dynamicConfigFiles = [ ] ;
140+ try {
141+ dynamicConfigFiles = readdirSync ( dynamicConfigPath ) . map ( ( file ) => ( { file, path : dynamicConfigPath } ) ) ;
142+ } catch ( error ) {
143+ console . log ( `Error reading dynamic config files: ${ error . message } ` ) ;
144+ }
120145
121146 const files = [ ...hardConfigFiles , ...dynamicConfigFiles ] ;
122147 const result = [ ] ;
0 commit comments