Skip to content

Commit 71e9e2c

Browse files
Added action to reveal submodule path
1 parent b948127 commit 71e9e2c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Commands/PBRemoteCommandFactory.m

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import "PBRemoteCommandFactory.h"
1010
#import "PBOpenDocumentCommand.h"
1111
#import "PBGitSubmodule.h"
12+
#import "PBRevealWithFinderCommand.h"
1213

1314

1415
@implementation PBRemoteCommandFactory
@@ -20,14 +21,6 @@ + (NSArray *) commandsForSubmodule:(PBGitSubmodule *) submodule inRepository:(PB
2021
NSString *path = [repoPath stringByAppendingPathComponent:[submodule path]];
2122
NSString *submodulePath = [submodule path];
2223

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-
3124
if ([submodule submoduleState] == PBGitSubmoduleStateNotInitialized) {
3225
NSArray *params = [NSArray arrayWithObjects:@"submodule", @"init", submodulePath, nil];
3326
PBCommand *initCmd = [[PBCommand alloc] initWithDisplayName:@"Init" parameters:params repository:repository];
@@ -52,6 +45,16 @@ + (NSArray *) commandsForSubmodule:(PBGitSubmodule *) submodule inRepository:(PB
5245
[commands addObject:updateRecursively];
5346
}
5447

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+
5558
return commands;
5659
}
5760

0 commit comments

Comments
 (0)