Skip to content
Snippets Groups Projects
Commit dee788f6 authored by George Nachman's avatar George Nachman
Browse files

Use App Support/iTerm2/Scripts if it exists, otherwise use App Support/iTerm/Scripts. Issue 5948

parent 89951c2d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -133,7 +133,14 @@ NSString * const DirectoryLocationDomain = @"DirectoryLocationDomain";
}
 
- (NSString *)scriptsPath {
return [[self legacyApplicationSupportDirectory] stringByAppendingPathComponent:@"Scripts"];
static dispatch_once_t onceToken;
NSString *legacyPath = [[self legacyApplicationSupportDirectory] stringByAppendingPathComponent:@"Scripts"];
NSString *modernPath = [[self applicationSupportDirectory] stringByAppendingPathComponent:@"Scripts"];
static BOOL useLegacy;
dispatch_once(&onceToken, ^{
useLegacy = [self fileExistsAtPath:legacyPath] && ![self fileExistsAtPath:modernPath];
});
return useLegacy ? legacyPath : modernPath;
}
 
- (NSString *)autolaunchScriptPath {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment