@@ -5,7 +5,7 @@ import { v4 as uuid } from 'uuid';
55import isEmpty from 'lodash/isEmpty' ;
66import { join , resolve } from 'path' ;
77import cloneDeep from 'lodash/cloneDeep' ;
8- import { cliux , sanitizePath , TableFlags , TableHeader , log , configHandler , CLIProgressManager , clearProgressModuleSetting , readContentTypeSchemas } from '@contentstack/cli-utilities' ;
8+ import { cliux , sanitizePath , TableFlags , TableHeader , log , configHandler , CLIProgressManager , clearProgressModuleSetting } from '@contentstack/cli-utilities' ;
99import { createWriteStream , existsSync , mkdirSync , readFileSync , writeFileSync , rmSync } from 'fs' ;
1010import config from './config' ;
1111import { print } from './util/log' ;
@@ -480,9 +480,10 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
480480 * `gfSchema`. The values of these properties are the parsed JSON data from two different files.
481481 */
482482 getCtAndGfSchema ( ) {
483- const ctDirPath = join (
483+ const ctPath = join (
484484 this . sharedConfig . basePath ,
485485 this . sharedConfig . moduleConfig [ 'content-types' ] . dirName ,
486+ this . sharedConfig . moduleConfig [ 'content-types' ] . fileName ,
486487 ) ;
487488 const gfPath = join (
488489 this . sharedConfig . basePath ,
@@ -491,7 +492,7 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
491492 ) ;
492493
493494 const gfSchema = existsSync ( gfPath ) ? ( JSON . parse ( readFileSync ( gfPath , 'utf8' ) ) as ContentTypeStruct [ ] ) : [ ] ;
494- const ctSchema = ( readContentTypeSchemas ( ctDirPath ) || [ ] ) as ContentTypeStruct [ ] ;
495+ const ctSchema = existsSync ( ctPath ) ? ( JSON . parse ( readFileSync ( ctPath , 'utf8' ) ) as ContentTypeStruct [ ] ) : [ ] ;
495496
496497 return { ctSchema, gfSchema } ;
497498 }
0 commit comments