Added action to reveal submodule path

This commit is contained in:
Tomasz Krasnyk
2010-11-28 21:16:19 +01:00
parent b948127cc2
commit 71e9e2cc43
+11 -8
View File
@@ -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;
}