mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] setting CWD in macOS launcher started via open command (IDEA-196722; TBX-3314)
GitOrigin-RevId: d8f424c6b12f804f7bf228193b01f1595f200aa9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
95e839c394
commit
3a48ccf804
@@ -464,17 +464,16 @@ NSString *getOverridePropertiesPath() {
|
||||
}
|
||||
|
||||
- (void)process_cwd {
|
||||
NSDictionary *jvmInfo = [[NSBundle mainBundle] objectForInfoDictionaryKey:JVMOptions];
|
||||
NSString *cwd = [jvmInfo objectForKey:@"WorkingDirectory"];
|
||||
if (cwd != nil && cwd != NULL) {
|
||||
cwd = [self expandMacros:cwd];
|
||||
if (chdir([cwd UTF8String]) != 0) {
|
||||
NSLog(@"Cannot chdir to working directory at %@", cwd);
|
||||
const char *cmd = getenv("_");
|
||||
if (cmd != NULL && strcmp(cmd, "/usr/bin/open") == 0) {
|
||||
const char *pwd = getenv("PWD");
|
||||
if (pwd != NULL && chdir(pwd) != 0) {
|
||||
NSLog(@"Cannot chdir() to %s", pwd);
|
||||
}
|
||||
} else {
|
||||
NSString *dir = [[NSFileManager defaultManager] currentDirectoryPath];
|
||||
NSLog(@"WorkingDirectory is absent in Info.plist. Current Directory: %@", dir);
|
||||
}
|
||||
|
||||
NSString *dir = [[NSFileManager defaultManager] currentDirectoryPath];
|
||||
NSLog(@"Current Directory: %@", dir);
|
||||
}
|
||||
|
||||
BOOL validationJavaVersion(){
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user