Skip to content

Commit

Permalink
fix(cordova): return proper pathForResource in CDVCommandDelegate (#1826
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jcesarmobile authored Jul 30, 2019
1 parent 7f70db8 commit 5b77f36
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ - (NSString*)pathForResource:(NSString*)resourcepath
[directoryParts removeLastObject];

NSString* directoryPartsJoined = [directoryParts componentsJoinedByString:@"/"];
NSString* baseFolder = @"public";
NSString* directoryStr = baseFolder;

if ([directoryPartsJoined length] > 0) {
directoryStr = [NSString stringWithFormat:@"%@/%@", baseFolder, [directoryParts componentsJoinedByString:@"/"]];
}

return [mainBundle pathForResource:filename ofType:@"" inDirectory:@"www"];
return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr];
}

- (void)flushCommandQueueWithDelayedJs
Expand Down

0 comments on commit 5b77f36

Please sign in to comment.