|
@@ -20,14 +20,15 @@ try {
|
20
|
20
|
fs.writeFileSync(PACKAGE_GRADLE, main);
|
21
|
21
|
console.log('adding OkHttp3 dependency to pre 0.28 project .. ok')
|
22
|
22
|
}
|
23
|
|
- else if (VERSION >= 0.40) {
|
24
|
|
- console.log('Adding RN040_IMPORT for RN >= 0.40 project ..')
|
|
23
|
+
|
|
24
|
+ if (VERSION < 0.40) {
|
|
25
|
+ console.log('Removing RN040_IMPORT for RN < 0.40 project ..')
|
25
|
26
|
glob('**/RNFetchBlob.h',{}, function(err, files) {
|
26
|
27
|
if(Array.isArray(files)) {
|
27
|
28
|
var target = process.cwd() + '/' + files[0];
|
28
|
29
|
console.log('\033[92mPatching .. \033[97m' + target);
|
29
|
30
|
var data = fs.readFileSync(target);
|
30
|
|
- fs.writeFileSync(target, String(data).replace(/\/\/#define RN040_IMPORT/, '#define RN040_IMPORT'));
|
|
31
|
+ fs.writeFileSync(target, String(data).replace(/#define RN040_IMPORT/, ''));
|
31
|
32
|
console.log('done.')
|
32
|
33
|
}
|
33
|
34
|
})
|