import { existsSync , mkdirSync } from 'fs' ; export function mkdirIfDoesNotExist ( path ) { const paths = path . split ( '/' ) ; const paths2 = [ ] ; while ( paths . length > 0 ) { paths2 . push ( paths . shift ( ) as string ) ; if ( ! existsSync ( paths2 . join ( '/' ) ) ) { mkdirSync ( paths2 . join ( '/' ) ) ; } } }