File tree 1 file changed +11
-18
lines changed
packages/cli-platform-apple/src/tools
1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import {
13
13
IOSDependencyConfig ,
14
14
} from '@react-native-community/cli-types' ;
15
15
import { ApplePlatform } from '../types' ;
16
- import readline from 'readline' ;
17
16
18
17
interface ResolvePodsOptions {
19
18
forceInstall ?: boolean ;
@@ -65,26 +64,20 @@ export function compareMd5Hashes(hash1?: string, hash2?: string) {
65
64
return hash1 === hash2 ;
66
65
}
67
66
68
- async function getChecksum ( podfileLockPath : string ) {
69
- const fileStream = fs . createReadStream ( podfileLockPath ) ;
67
+ async function getChecksum (
68
+ podfileLockPath : string ,
69
+ ) : Promise < string | undefined > {
70
+ const file = fs . readFileSync ( podfileLockPath , 'utf8' ) ;
70
71
71
- const rl = readline . createInterface ( {
72
- input : fileStream ,
73
- crlfDelay : Infinity ,
74
- } ) ;
72
+ const checksumLine = file
73
+ . split ( '\n' )
74
+ . find ( ( line ) => line . includes ( 'PODFILE CHECKSUM' ) ) ;
75
75
76
- let lines = [ ] ;
77
- for await ( const line of rl ) {
78
- lines . push ( line ) ;
76
+ if ( checksumLine ) {
77
+ return checksumLine . split ( ': ' ) [ 1 ] ;
78
+ } else {
79
+ return undefined ;
79
80
}
80
-
81
- lines = lines . reverse ( ) ;
82
-
83
- return lines
84
- . filter ( ( line ) => line . includes ( 'PODFILE CHECKSUM' ) ) [ 0 ]
85
- . split ( ': ' ) [ 1 ]
86
-
87
- return undefined ;
88
81
}
89
82
90
83
async function install (
You can’t perform that action at this time.
0 commit comments