public
Fork of Caged/gitnub
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/dustin/gitnub.git
Don't hardcode the path to the GitNub application in the nub CLI tool.

I didn't want to install GitNub in /Applications, which caused the nub
command to fail terribly.  This change uses the standard cocoa
NSWorkspace API for opening applications with paths.

Note that this changes causes a slightly different, but more
``normal'' behavior for applications.

If it is desirable to have multiple repos open at the same time, that
should be handled in the application itself.  This invocation via nub
should already do the right thing to accommodate that.
dustin (author)
Wed Mar 12 16:15:49 -0700 2008
commit  c9db2c13ce5beff291191d14a6130072560a5fc0
tree    62fb5efd05816825b32cd47edc0be94e6bc4dde2
parent  dbe195471fd7fe6441325d1ebcb6a64b51878828
...
1
 
2
3
 
4
5
 
6
7
8
9
10
11
12
 
 
 
 
 
 
 
13
14
15
...
 
1
2
3
4
5
 
6
7
 
 
 
 
 
 
8
9
10
11
12
13
14
15
16
17
0
@@ -1,15 +1,17 @@
0
-#import <Foundation/Foundation.h>
0
+#import <Cocoa/Cocoa.h>
0
 
0
 int main (int argc, const char * argv[]) {
0
+ char buf[PATH_MAX];
0
     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
0
-
0
+
0
     // NSArray *myArgs = [[NSProcessInfo processInfo] arguments];
0
- // NSLog(@"%@", myArgs);
0
-
0
- NSTask *task = [[NSTask alloc] init];
0
- [task setLaunchPath:@"/Applications/GitNub.app/Contents/MacOS/GitNub"];
0
- [task launch];
0
-
0
+ // NSLog(@"%@", myArgs);
0
+
0
+ NSString *path=[[NSString alloc] initWithCString:getcwd(buf, sizeof(buf))];
0
+
0
+ [[NSWorkspace sharedWorkspace] openFile:path withApplication:@"GitNub"];
0
+
0
+ [path release];
0
     [pool drain];
0
     return 0;
0
 }
...
10
11
12
 
13
14
15
...
31
32
33
 
34
35
36
...
39
40
41
 
42
43
44
...
68
69
70
 
71
72
73
...
10
11
12
13
14
15
16
...
32
33
34
35
36
37
38
...
41
42
43
44
45
46
47
...
71
72
73
74
75
76
77
0
@@ -10,6 +10,7 @@
0
     8DD76F9A0486AA7600D96B5E /* nub.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* nub.m */; settings = {ATTRIBUTES = (); }; };
0
     8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
0
     8DD76F9F0486AA7600D96B5E /* nub.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859EA3029092ED04C91782 /* nub.1 */; };
0
+ DA2B05160D8897590018BF34 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA2B05150D8897590018BF34 /* Cocoa.framework */; };
0
 /* End PBXBuildFile section */
0
 
0
 /* Begin PBXCopyFilesBuildPhase section */
0
@@ -31,6 +32,7 @@
0
     32A70AAB03705E1F00C91783 /* nub_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nub_Prefix.pch; sourceTree = "<group>"; };
0
     8DD76FA10486AA7600D96B5E /* nub */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = nub; sourceTree = BUILT_PRODUCTS_DIR; };
0
     C6859EA3029092ED04C91782 /* nub.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = nub.1; sourceTree = "<group>"; };
0
+ DA2B05150D8897590018BF34 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
0
 /* End PBXFileReference section */
0
 
0
 /* Begin PBXFrameworksBuildPhase section */
0
@@ -39,6 +41,7 @@
0
       buildActionMask = 2147483647;
0
       files = (
0
         8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */,
0
+ DA2B05160D8897590018BF34 /* Cocoa.framework in Frameworks */,
0
       );
0
       runOnlyForDeploymentPostprocessing = 0;
0
     };
0
@@ -68,6 +71,7 @@
0
     08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
0
       isa = PBXGroup;
0
       children = (
0
+ DA2B05150D8897590018BF34 /* Cocoa.framework */,
0
         08FB779EFE84155DC02AAC07 /* Foundation.framework */,
0
       );
0
       name = "External Frameworks and Libraries";

Comments

    No one has commented yet.