mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 09:31:20 +08:00
[REPL/OSX] Make it work when codesigned and sandboxed.
Fixes http://hipbyte.myjetbrains.com/youtrack/issue/RM-410
This commit is contained in:
24
bin/sim.m
24
bin/sim.m
@@ -1334,16 +1334,20 @@ main(int argc, char **argv)
|
||||
environment] mutableCopy];
|
||||
if (debug_mode != DEBUG_NOTHING) {
|
||||
// Prepare repl socket path.
|
||||
NSString *tmpdir = NSTemporaryDirectory();
|
||||
assert(tmpdir != nil);
|
||||
char path[PATH_MAX];
|
||||
snprintf(path, sizeof path, "%s/rubymotion-repl-XXXXXX",
|
||||
[tmpdir fileSystemRepresentation]);
|
||||
assert(mktemp(path) != NULL);
|
||||
replSocketPath = [[[NSFileManager defaultManager]
|
||||
stringWithFileSystemRepresentation:path length:strlen(path)]
|
||||
retain];
|
||||
[appEnvironment setObject:replSocketPath forKey:@"REPL_SOCKET_PATH"];
|
||||
replSocketPath = [appEnvironment[@"REPL_SOCKET_PATH"] retain];
|
||||
if (replSocketPath == nil) {
|
||||
NSString *tmpdir = NSTemporaryDirectory();
|
||||
assert(tmpdir != nil);
|
||||
char path[PATH_MAX];
|
||||
snprintf(path, sizeof path, "%s/rubymotion-repl-XXXXXX",
|
||||
[tmpdir fileSystemRepresentation]);
|
||||
assert(mktemp(path) != NULL);
|
||||
replSocketPath = [[[NSFileManager defaultManager]
|
||||
stringWithFileSystemRepresentation:path length:strlen(path)]
|
||||
retain];
|
||||
[appEnvironment setObject:replSocketPath
|
||||
forKey:@"REPL_SOCKET_PATH"];
|
||||
}
|
||||
|
||||
// Make sure the unix socket path does not exist.
|
||||
[[NSFileManager defaultManager] removeItemAtPath:replSocketPath
|
||||
|
||||
Reference in New Issue
Block a user