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
This commit is contained in:
Kevin Sawicki
2013-01-22 15:58:11 -08:00
parent 9b10278557
commit a9d3d010d9

View File

@@ -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;
}