app/middleware/project.js
function _findProjectPathById(id) {
  logger.debug('_findProjectPathById');
  logger.debug(id);
  var projectPathToReturn;
  var workspaces = config.get('mm_workspace');
  if (!_.isArray(workspaces)) {
    workspaces = [workspaces];
  }
  logger.silly(workspaces);
  _.each(workspaces, function(workspacePath) {
    // /foo/bar/project
    // /foo/bar/project/config/.settings
    logger.silly(workspacePath);
    var projectPaths = util.listDirectories(workspacePath);
    logger.silly(projectPaths);
    _.each(projectPaths, function(projectPath) {
      var settingsPath = path.join(projectPath, 'config', '.settings');
      if (fs.existsSync(settingsPath)) {
        var settings = util.getFileBody(settingsPath, true);
        if (settings.id === id) {
          projectPathToReturn = projectPath;
          return false;
        }
      }
    });
  });
  return projectPathToReturn;
}
function _findProjectPathById(id) {
  logger.debug('_findProjectPathById');
  logger.debug(id);
  var projectPathToReturn;
  var workspaces = config.get('mm_workspace');
  if (!_.isArray(workspaces)) {
    workspaces = [workspaces];
  }
  logger.silly(workspaces);
  _.each(workspaces, function(workspacePath) {
    // /foo/bar/project
    // /foo/bar/project/config/.settings
    logger.silly(workspacePath);
    var projectPaths = util.listDirectories(workspacePath);
    logger.silly(projectPaths);
    _.each(projectPaths, function(projectPath) {
      var settingsPath = path.join(projectPath, 'config', '.settings');
      if (fs.existsSync(settingsPath)) {
        var settings = util.getFileBody(settingsPath, true);
        if (settings.id === id) {
          projectPathToReturn = projectPath;
          return false;
        }
      }
    });
  });
  return projectPathToReturn;
}
function _findProjectPathById ( id ) { logger . debug ( '_findProjectPathById' ) ; logger . debug ( id ) ; var projectPathToReturn ; var workspaces = config . get ( 'mm_workspace' ) ; if ( ! _ . isArray ( workspaces ) ) { workspaces = [ workspaces ] ; } logger . silly ( workspaces ) ; _ . each ( workspaces , function ( workspacePath ) { // /foo/bar/project // /foo/bar/project/config/.settings logger . silly ( workspacePath ) ; var projectPaths = util . listDirectories ( workspacePath ) ; logger . silly ( projectPaths ) ; _ . each ( projectPaths , function ( projectPath ) { var settingsPath = path . join ( projectPath , 'config' , '.settings' ) ; if ( fs . existsSync ( settingsPath ) ) { var settings = util . getFileBody ( settingsPath , true ) ; if ( settings . id === id ) { projectPathToReturn = projectPath ; return false ; } } } ) ; } ) ; return projectPathToReturn ; }
Given a project id, search given workspaces to find it on the disk
@param  {String} id mavensmate project id
@return {String}    project path
Given a project id search given workspaces to find it on the disk