Skip to content

Commit

Permalink
symlink bundled plugins when plugin directory changed
Browse files Browse the repository at this point in the history
  • Loading branch information
iosdeveloper committed Feb 21, 2016
1 parent ee10b20 commit 69f2463
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions App/BitBar/PluginManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ - (BOOL) beginSelectingPluginsDir {
BOOL isDir = NO;
if ([[NSFileManager defaultManager] fileExistsAtPath: openDlg.URL.path isDirectory: &isDir]
&& isDir) {
// symlink bundled plugins in selected directory
self.path = [NSBundle mainBundle].executablePath.stringByDeletingLastPathComponent;
NSArray *pluginFiles = [self pluginFilesWithAsking:NO];
for (NSString *file in pluginFiles)
[[NSFileManager defaultManager] createSymbolicLinkAtPath:[openDlg.URL.path stringByAppendingPathComponent:file]
withDestinationPath:[self.path stringByAppendingPathComponent:file]
error:nil];

self.path = [openDlg.URL path];
[DEFS setPluginsDirectory:self.path];
Expand Down

0 comments on commit 69f2463

Please sign in to comment.