From a9d3d010d996dd83dd409bf1062fb777ffa193cf Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 22 Jan 2013 15:58:11 -0800 Subject: [PATCH] Use executed-from argument when path is missing This still allows atom to open its own source when run from Xcode but will now use the current working directory when launched from the command line with no path argument. Closes #139 --- native/atom_application.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/native/atom_application.mm b/native/atom_application.mm index 8eab6bfc5..a40e5fd11 100644 --- a/native/atom_application.mm +++ b/native/atom_application.mm @@ -87,9 +87,13 @@ NSString *path = [NSString stringWithUTF8String:cleanArgv[0]]; path = [self standardizePathToOpen:path withArguments:arguments]; [arguments setObject:path forKey:@"path"]; + } else { + NSString *executedFromPath = [arguments objectForKey:@"executed-from"]; + if (executedFromPath) { + [arguments setObject:executedFromPath forKey:@"path"]; + } } - return arguments; }