import themeX = require ( './themeX' ) ; import loader = require ( './loader' ) ; import checker = require ( './checkcore' ) ; import fs = require ( 'fs' ) ; import path = require ( 'path' ) ; export = ( ) : number => { const file = findBundleAddress ( ) ; if ( file != undefined ) { const check = checker ( loader . loadProjectByFile ( file ) ) ; if ( check ) { themeX . print ( 'test: passed.' ) ; return 0 ; } else { themeX . print ( 'test: failed' ) ; return 1 ; } } else { themeX . report ( 'no themeX files found.' ) ; } } ; function findBundleAddress ( ) { for ( const file of fs . readdirSync ( process . cwd ( ) ) ) if ( file . toLowerCase ( ) . endsWith ( '.themex' ) ) return path . join ( process . cwd ( ) , file ) ; return undefined ; }