nl_tokens: -------------------------------- HELPER METHODS --------------------------------
pl_tokens: function checkRootDir ( ) { return fs . pathExists ( rootDirPath ) . then ( exists => { if ( ! exists ) { // throw new Error(chalk.red(`Target directory does not exist: '${rootDirPath}'`)); return fs . ensureDir ( rootDirPath ) . <mask> ( ( ) => rootDirPath ) ; } return fs . lstat ( rootDirPath ) . then ( stats => { if ( ! stats . isDirectory ( ) ) { throw new Error ( chalk . red ( ` ${ rootDirPath } \n ` ) ) ; } return utils . fs . isEmptyDir ( rootDirPath ) ; } ) . then ( empty => { if ( ! empty ) { throw new Error ( chalk . yellow ( ` ${ rootDirPath } \n ` ) ) ; } return rootDirPath ; } ) ; } ) ; }