diff --git a/Commands/PBRemoteCommandFactory.m b/Commands/PBRemoteCommandFactory.m index 29b1494..2b02524 100644 --- a/Commands/PBRemoteCommandFactory.m +++ b/Commands/PBRemoteCommandFactory.m @@ -9,6 +9,7 @@ #import "PBRemoteCommandFactory.h" #import "PBOpenDocumentCommand.h" #import "PBGitSubmodule.h" +#import "PBRevealWithFinderCommand.h" @implementation PBRemoteCommandFactory @@ -20,14 +21,6 @@ NSString *path = [repoPath stringByAppendingPathComponent:[submodule path]]; NSString *submodulePath = [submodule path]; - if ([submodule submoduleState] != PBGitSubmoduleStateNotInitialized) { - // open - PBOpenDocumentCommand *command = [[PBOpenDocumentCommand alloc] initWithDocumentAbsolutePath:path]; - command.commandTitle = command.displayName; - command.commandDescription = @"Opening document"; - [commands addObject:command]; - } - if ([submodule submoduleState] == PBGitSubmoduleStateNotInitialized) { NSArray *params = [NSArray arrayWithObjects:@"submodule", @"init", submodulePath, nil]; PBCommand *initCmd = [[PBCommand alloc] initWithDisplayName:@"Init" parameters:params repository:repository]; @@ -52,6 +45,16 @@ [commands addObject:updateRecursively]; } + if ([submodule submoduleState] != PBGitSubmoduleStateNotInitialized) { + // open + PBOpenDocumentCommand *command = [[PBOpenDocumentCommand alloc] initWithDocumentAbsolutePath:path]; + command.commandTitle = command.displayName; + command.commandDescription = @"Opening document"; + [commands addObject:command]; + + [commands addObject:[[PBRevealWithFinderCommand alloc] initWithDocumentAbsolutePath:path]]; + } + return commands; }