()
| 60 | } |
| 61 | |
| 62 | function checkAndCleanExpoConfig() { |
| 63 | const majorVersion = getExpoMajorVersion(); |
| 64 | |
| 65 | // Condition: Expo not found OR major version is less than 50 |
| 66 | if (majorVersion === null || majorVersion < 50) { |
| 67 | if (fs.existsSync(expoConfigPath)) { |
| 68 | try { |
| 69 | fs.unlinkSync(expoConfigPath); |
| 70 | console.log( |
| 71 | `Expo version (${ |
| 72 | majorVersion !== null ? majorVersion : 'not found' |
| 73 | }) is < 50 or Expo not found. Deleted ${expoConfigPath}`, |
| 74 | ); |
| 75 | } catch (error) { |
| 76 | console.error(`Failed to delete ${expoConfigPath}:`, error); |
| 77 | } |
| 78 | } else { |
| 79 | console.log( |
| 80 | `Expo version (${ |
| 81 | majorVersion !== null ? majorVersion : 'not found' |
| 82 | }) is < 50 or Expo not found. ${expoConfigPath} does not exist, no action needed.`, |
| 83 | ); |
| 84 | } |
| 85 | } else { |
| 86 | console.log( |
| 87 | `Expo version (${majorVersion}) is >= 50. Kept ${expoConfigPath}`, |
| 88 | ); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | checkAndCleanExpoConfig(); |
no test coverage detected