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

Commit 42478bd

Browse files
committed
Change relink script error handling #116
1 parent 5ebf15a commit 42478bd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/scripts/prelink.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ var PACKAGE_JSON = process.cwd() + '/package.json';
66
var hasNecessaryFile = fs.existsSync(MANIFEST_PATH) && fs.existsSync(MANIFEST_PATH);
77

88
if (!hasNecessaryFile) {
9-
throw 'RNFetchBlob could not found link Android automatically, some files could not be found.'
9+
console.log('\033[31m*** react-native-fetch-blob pre-link FAILED ***')
10+
console.log('\033[31mRNFetchBlob could not link Android automatically, some files could not be found.')
11+
console.log('\033[31mYou may have to manually link the library, see \033[36mhttps://github.com/wkh237/react-native-fetch-blob#manually-link-the-package-android \033[31mfor more information.')
12+
return
1013
}
1114

1215
var package = JSON.parse(fs.readFileSync(PACKAGE_JSON));
@@ -20,7 +23,11 @@ console.log('RNFetchBlob detected app version .. ' + VERSION);
2023
if(VERSION >= 0.29) {
2124
console.log('RNFetchBlob patching MainApplication.java .. ');
2225
if(!fs.existsSync(APPLICATION_MAIN)) {
23-
throw 'RNFetchBlob could not link Android automatically, MainApplication.java not found in path : ' + APPLICATION_MAIN
26+
console.log('\033[31m*** react-native-fetch-blob pre-link FAILED ***')
27+
console.log('\033[31mRNFetchBlob could not link Android automatically, MainApplication.java not found in path : ' + APPLICATION_MAIN)
28+
console.log('\033[31mRNFetchBlob could not link Android automatically, some files could not be found.')
29+
console.log('\033[31mTry manually link the library, see \033[36mhttps://github.com/wkh237/react-native-fetch-blob#manually-link-the-package-android \033[31mfor more information.')
30+
return
2431
}
2532
var main = fs.readFileSync(APPLICATION_MAIN);
2633
if(String(main).match('new RNFetchBlobPackage()') !== null) {

0 commit comments

Comments
 (0)