examples/placesuidemo/rn-rename.js
function renameFilesIOS (oldPackageName, newPackageName) {
  const filesAndFolders = [
    `ios/${oldPackageName}.xcodeproj/xcshareddata/xcschemes/<?>-tvOS.xcscheme`,
    `ios/${oldPackageName}.xcodeproj/xcshareddata/xcschemes/<?>.xcscheme`,
    'ios/<?>.xcodeproj',
    `ios/${oldPackageName}/<?>.entitlements`,
    'ios/<?>',
    'ios/<?>-tvOS',
    'ios/<?>-tvOSTests',
    `ios/${oldPackageName}Tests/<?>Tests.m`,
    'ios/<?>Tests',
    'ios/<?>.xcworkspace',
  ]

  for (let i = 0; i < filesAndFolders.length; i++) {
    const element = filesAndFolders[i]
    const srcFile = fullPath(element.replace('<?>', oldPackageName))

    console.log(`From ${relative(srcFile)}`)
    if (fs.existsSync(srcFile)) {
      const destFile = fullPath(element.replace('<?>', newPackageName))

      fs.renameSync(srcFile, destFile)
      console.log(`  to ${relative(destFile)}`)
    } else {
      console.log(`${srcFile} does not exists.`)
    }
  }
}
function renameFilesIOS (oldPackageName, newPackageName) {
  const filesAndFolders = [
    `ios/${oldPackageName}.xcodeproj/xcshareddata/xcschemes/<?>-tvOS.xcscheme`,
    `ios/${oldPackageName}.xcodeproj/xcshareddata/xcschemes/<?>.xcscheme`,
    'ios/<?>.xcodeproj',
    `ios/${oldPackageName}/<?>.entitlements`,
    'ios/<?>',
    'ios/<?>-tvOS',
    'ios/<?>-tvOSTests',
    `ios/${oldPackageName}Tests/<?>Tests.m`,
    'ios/<?>Tests',
    'ios/<?>.xcworkspace',
  ]

  for (let i = 0; i < filesAndFolders.length; i++) {
    const element = filesAndFolders[i]
    const srcFile = fullPath(element.replace('<?>', oldPackageName))

    console.log(`From ${relative(srcFile)}`)
    if (fs.existsSync(srcFile)) {
      const destFile = fullPath(element.replace('<?>', newPackageName))

      fs.renameSync(srcFile, destFile)
      console.log(`  to ${relative(destFile)}`)
    } else {
      console.log(`${srcFile} does not exists.`)
    }
  }
}
function renameFilesIOS ( oldPackageName , newPackageName ) { const filesAndFolders = [ ` ${ oldPackageName } ` , ` ${ oldPackageName } ` , 'ios/<?>.xcodeproj' , ` ${ oldPackageName } ` , 'ios/<?>' , 'ios/<?>-tvOS' , 'ios/<?>-tvOSTests' , ` ${ oldPackageName } ` , 'ios/<?>Tests' , 'ios/<?>.xcworkspace' , ] for ( let i = 0 ; i < filesAndFolders . length ; i ++ ) { const element = filesAndFolders [ i ] const srcFile = fullPath ( element . replace ( '<?>' , oldPackageName ) ) console . log ( ` ${ relative ( srcFile ) } ` ) if ( fs . existsSync ( srcFile ) ) { const destFile = fullPath ( element . replace ( '<?>' , newPackageName ) ) fs . renameSync ( srcFile , destFile ) console . log ( ` ${ relative ( destFile ) } ` ) } else { console . log ( ` ${ srcFile } ` ) } } }
Move files and folders
Move files and folders