hooks/iosBeforePrepareHook.js
function getOldProjectName(projectDir) {
  var files = [];
  try {
    files = fs.readdirSync(projectDir);
  } catch (err) {
    return '';
  }

  var projectFile = '';
  files.forEach(function(fileName) {
    if (path.extname(fileName) === '.xcodeproj') {
      projectFile = path.basename(fileName, '.xcodeproj');
    }
  });

  return projectFile;
}
function getOldProjectName(projectDir) {
  var files = [];
  try {
    files = fs.readdirSync(projectDir);
  } catch (err) {
    return '';
  }

  var projectFile = '';
  files.forEach(function(fileName) {
    if (path.extname(fileName) === '.xcodeproj') {
      projectFile = path.basename(fileName, '.xcodeproj');
    }
  });

  return projectFile;
}
function getOldProjectName ( projectDir ) { var files = [ ] ; try { files = fs . readdirSync ( projectDir ) ; } catch ( err ) { return '' ; } var projectFile = '' ; files . forEach ( function ( fileName ) { if ( path . extname ( fileName ) === '.xcodeproj' ) { projectFile = path . basename ( fileName , '.xcodeproj' ) ; } } ) ; return projectFile ; }
region Private API 
Get old name of the project.
Name is detected by the name of the .xcodeproj file.

@param {String} projectDir absolute path to ios project directory
@return {String} old project name
region Private API Get old name of the project . Name is detected by the name of the . xcodeproj file .