9
9
#import " PBRemoteCommandFactory.h"
10
10
#import " PBOpenDocumentCommand.h"
11
11
#import " PBGitSubmodule.h"
12
+ #import " PBRevealWithFinderCommand.h"
12
13
13
14
14
15
@implementation PBRemoteCommandFactory
@@ -20,14 +21,6 @@ + (NSArray *) commandsForSubmodule:(PBGitSubmodule *) submodule inRepository:(PB
20
21
NSString *path = [repoPath stringByAppendingPathComponent: [submodule path ]];
21
22
NSString *submodulePath = [submodule path ];
22
23
23
- if ([submodule submoduleState ] != PBGitSubmoduleStateNotInitialized) {
24
- // open
25
- PBOpenDocumentCommand *command = [[PBOpenDocumentCommand alloc ] initWithDocumentAbsolutePath: path];
26
- command.commandTitle = command.displayName ;
27
- command.commandDescription = @" Opening document" ;
28
- [commands addObject: command];
29
- }
30
-
31
24
if ([submodule submoduleState ] == PBGitSubmoduleStateNotInitialized) {
32
25
NSArray *params = [NSArray arrayWithObjects: @" submodule" , @" init" , submodulePath, nil ];
33
26
PBCommand *initCmd = [[PBCommand alloc ] initWithDisplayName: @" Init" parameters: params repository: repository];
@@ -52,6 +45,16 @@ + (NSArray *) commandsForSubmodule:(PBGitSubmodule *) submodule inRepository:(PB
52
45
[commands addObject: updateRecursively];
53
46
}
54
47
48
+ if ([submodule submoduleState ] != PBGitSubmoduleStateNotInitialized) {
49
+ // open
50
+ PBOpenDocumentCommand *command = [[PBOpenDocumentCommand alloc ] initWithDocumentAbsolutePath: path];
51
+ command.commandTitle = command.displayName ;
52
+ command.commandDescription = @" Opening document" ;
53
+ [commands addObject: command];
54
+
55
+ [commands addObject: [[PBRevealWithFinderCommand alloc ] initWithDocumentAbsolutePath: path]];
56
+ }
57
+
55
58
return commands;
56
59
}
57
60
0 commit comments