function(key,endWithSeparator) {
        var filepath = this.loadNecessaryFile(key);
        if (!filepath) {
            exitProcess('empty directory for ' + key, this.alarm);
            return false;
        }
        if (!fs.lstatSync(filepath).isDirectory()) {
            exitProcess('the path '+filepath + ' must be a directory', this.alarm);
            return false;
        }
        if (endWithSeparator && !filepath.endWith(path.sep)) {
            exitProcess('the path '+filepath + ' must be end with a separator', this.alarm);
            return false;
        }
        return filepath;
    }
function(key,endWithSeparator) {
        var filepath = this.loadNecessaryFile(key);
        if (!filepath) {
            exitProcess('empty directory for ' + key, this.alarm);
            return false;
        }
        if (!fs.lstatSync(filepath).isDirectory()) {
            exitProcess('the path '+filepath + ' must be a directory', this.alarm);
            return false;
        }
        if (endWithSeparator && !filepath.endWith(path.sep)) {
            exitProcess('the path '+filepath + ' must be end with a separator', this.alarm);
            return false;
        }
        return filepath;
    }
function ( key , endWithSeparator ) { var filepath = this . loadNecessaryFile ( key ) ; if ( ! filepath ) { exitProcess ( 'empty directory for ' + key , this . alarm ) ; return false ; } if ( ! fs . lstatSync ( filepath ) . isDirectory ( ) ) { exitProcess ( 'the path ' + filepath + ' must be a directory' , this . alarm ) ; return false ; } if ( endWithSeparator && ! filepath . endWith ( path . sep ) ) { exitProcess ( 'the path ' + filepath + ' must be end with a separator' , this . alarm ) ; return false ; } return filepath ; }
Get directory path by key, the value must be exist, otherwise the process will exit.

@param {KeyItem} key
@param {Boolean} [endWithSeparator=false] If set ture, the key must be end with `/`(Linux) or `\`(Windows).
@returns {String}
Get directory path by key the value must be exist otherwise the process will exit .