Skip to content

Commit 5f88e01

Browse files
tripodsanshazron
authored andcommitted
CB-9544 Add file plugin for OSX (closes apache#130)
- use applications resource path for the `applicationDirectory` to match other platforms expectation where the 'www' directoy is
1 parent b374979 commit 5f88e01

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ properties are `null`.
190190

191191
| Device Path | `cordova.file.*` | `iosExtraFileSystems` | r/w? | OS clears | private |
192192
|:-------------------------------------------------|:----------------------------|:----------------------|:----:|:---------:|:-------:|
193-
| `/Applications/<appname>.app` | applicationDirectory | bundle | r | N/A | Yes |
193+
| `/Applications/<appname>.app/` | - | bundle | r | N/A | Yes |
194+
| &nbsp;&nbsp;&nbsp;&nbsp;`Content/Resources/` | applicationDirectory | - | r | N/A | Yes |
194195
| `~/Library/Application Support/<bundle-id>/` | applicationStorageDirectory | - | r/w | No | Yes |
195196
| &nbsp;&nbsp;&nbsp;&nbsp;`files/` | dataDirectory | - | r/w | No | Yes |
196197
| `~/Documents/` | documentsDirectory | documents | r/w | No | No |

src/osx/CDVFile.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ - (void)requestAllFileSystems:(CDVInvokedUrlCommand*)command
452452
- (void)requestAllPaths:(CDVInvokedUrlCommand*)command
453453
{
454454
NSDictionary* ret = @{
455-
@"applicationDirectory": [[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]] absoluteString],
455+
@"applicationDirectory": [[NSURL fileURLWithPath:[[NSBundle mainBundle] resourcePath]] absoluteString],
456456
@"applicationStorageDirectory": [[NSURL fileURLWithPath:self.appSupportPath] absoluteString],
457457
@"dataDirectory": [[NSURL fileURLWithPath:self.appDataPath] absoluteString],
458458
@"documentsDirectory": [[NSURL fileURLWithPath:self.appDocsPath] absoluteString],

0 commit comments

Comments
 (0)