Skip to content

Commit

Permalink
[HOTFIX] Create plugins directory on fresh install prior to HorosClou…
Browse files Browse the repository at this point in the history
…d deployment
  • Loading branch information
fvpolpeta committed Jun 21, 2018
1 parent c5a0bf3 commit 42243b0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Horos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<key>CFBundleExecutable</key>
<string>Horos</string>
<key>CFBundleGetInfoString</key>
<string>Horos v3.1.0</string>
<string>Horos v3.1.1</string>
<key>CFBundleIconFile</key>
<string>Horos.icns</string>
<key>CFBundleIdentifier</key>
Expand All @@ -203,7 +203,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.1.0</string>
<string>3.1.1</string>
<key>CFBundleSignature</key>
<string>OsiX</string>
<key>CFBundleSupportedPlatforms</key>
Expand Down Expand Up @@ -238,7 +238,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>20180620</string>
<string>20180621</string>
<key>GitHash</key>
<string></string>
<key>GitState</key>
Expand Down
39 changes: 23 additions & 16 deletions Horos/Sources/PluginManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -739,27 +739,34 @@ + (void) deployHorosCloudPluginAtPath:(NSString*) path deployedPlugins:(NSMutabl
{
BOOL foundHorosCloud = NO;

NSNumber* flag = [[NSUserDefaults standardUserDefaults] objectForKey:@"HOROSCLOUD_PLUGIN_DEPLOYED"];
if (flag == nil || [flag integerValue] == 0)
if ([[NSFileManager defaultManager] fileExistsAtPath:path] == NO)
{
for (NSInteger i = deployedPlugins.count-1; i >= 0; --i)
[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
}
else
{
NSNumber* flag = [[NSUserDefaults standardUserDefaults] objectForKey:@"HOROSCLOUD_PLUGIN_DEPLOYED"];
if (flag == nil || [flag integerValue] == 0)
{
NSBundle* bundle = [NSBundle bundleWithPath:[deployedPlugins objectAtIndex:i]];
NSString* name = [bundle.infoDictionary objectForKey:@"CFBundleName"];
if (!name)
for (NSInteger i = deployedPlugins.count-1; i >= 0; --i)
{
name = [[[deployedPlugins objectAtIndex:i] lastPathComponent] stringByDeletingPathExtension];
}

if( [name caseInsensitiveCompare:@"HorosCloud"] == NSOrderedSame ) {
foundHorosCloud = YES;
break;
NSBundle* bundle = [NSBundle bundleWithPath:[deployedPlugins objectAtIndex:i]];
NSString* name = [bundle.infoDictionary objectForKey:@"CFBundleName"];
if (!name)
{
name = [[[deployedPlugins objectAtIndex:i] lastPathComponent] stringByDeletingPathExtension];
}

if( [name caseInsensitiveCompare:@"HorosCloud"] == NSOrderedSame ) {
foundHorosCloud = YES;
break;
}
}
}
}
else
{
foundHorosCloud = YES;
else
{
foundHorosCloud = YES;
}
}

if (!foundHorosCloud)
Expand Down

0 comments on commit 42243b0

Please sign in to comment.