mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Added action to reveal submodule path
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user