Commit e42d5232 authored by Travis Nuttall's avatar Travis Nuttall

remove leading directory path from file slug

fixes #46
parent 870257fc
......@@ -169,7 +169,11 @@ public class RNThreadModule extends ReactContextBaseJavaModule implements Lifecy
private JSBundleLoader createDevBundleLoader(String jsFileName, String jsFileSlug) {
String bundleUrl = bundleUrlForFile(jsFileName);
String bundleOut = getReactApplicationContext().getFilesDir().getAbsolutePath() + "/" + jsFileSlug;
// nested file directory will not exist in the files dir during development,
// so remove any leading directory paths to simply download a flat file into
// the root of the files directory.
String[] splitFileSlug = jsFileSlug.split("/");
String bundleOut = getReactApplicationContext().getFilesDir().getAbsolutePath() + "/" + splitFileSlug[splitFileSlug.length - 1];
Log.d(TAG, "createDevBundleLoader - download web thread to - " + bundleOut);
downloadScriptToFileSync(bundleUrl, bundleOut);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment