Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit bb20e36

Browse files
authored
Merge pull request #235 from mgiachetti/fix/prelink-rn40
Fix prelink for rn 0.40
2 parents 7ef12ec + 510fbe8 commit bb20e36

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/ios/RNFetchBlob/RNFetchBlob.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66

77
//XXX: DO NO REMOVE THIS LINE IF YOU'RE USING IT ON RN > 0.40 PROJECT
8-
//#define RN040_IMPORT
8+
#define RN040_IMPORT
99

1010

1111
#ifndef RNFetchBlob_h

src/scripts/prelink.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ try {
2020
fs.writeFileSync(PACKAGE_GRADLE, main);
2121
console.log('adding OkHttp3 dependency to pre 0.28 project .. ok')
2222
}
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 ..')
2526
glob('**/RNFetchBlob.h',{}, function(err, files) {
2627
if(Array.isArray(files)) {
2728
var target = process.cwd() + '/' + files[0];
2829
console.log('\033[92mPatching .. \033[97m' + target);
2930
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/, ''));
3132
console.log('done.')
3233
}
3334
})

0 commit comments

Comments
 (0)