MCPcopy Create free account
hub / github.com/reactnativecn/react-native-update / checkAndCleanExpoConfig

Function checkAndCleanExpoConfig

scripts/check-expo-version.js:62–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62function 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
92checkAndCleanExpoConfig();

Callers 1

Calls 2

getExpoMajorVersionFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected