import { existsSync , mkdirSync , readFileSync } from "fs" ; import { dirname } from "path" ; export function mkdirsSync ( dir ) { if ( existsSync ( dir ) ) { return true ; } else { if ( mkdirsSync ( dirname ( dir ) ) ) { mkdirSync ( dir ) ; return true ; } } } export function getWorkspaceConfig ( ) { return ( existsSync ( './autojs.json' ) && JSON . parse ( readFileSync ( './autojs.json' , 'utf-8' ) ) ) || null ; } export function firstUpperCase ( str ) { return str . split ( '' ) . map ( ( val , index ) => { return index === 0 ? val . toUpperCase ( ) : val ; } ) . join ( '' ) ; }