aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPBundleCommandRunner.m
diff options
context:
space:
mode:
authorAbhi Beckert <abhi@Twist-of-Lemon-2.local>2015-05-16 08:06:06 +1000
committerAbhi Beckert <abhi@Twist-of-Lemon-2.local>2015-05-16 08:06:06 +1000
commit57a6f6c73bdaa202164645370d37fcbe5d14a092 (patch)
treedd30aa6156064f1d4c0e10ea87059625470fc2f9 /Source/SPBundleCommandRunner.m
parentb5e972f4504043dfb9c358e272e93fb59ae2127f (diff)
parent0f0c43eb74408b6a65a42e2c6fd46f4142ef8e3f (diff)
downloadsequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.tar.gz
sequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.tar.bz2
sequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.zip
Merge remote-tracking branch 'sequelpro/master'
Diffstat (limited to 'Source/SPBundleCommandRunner.m')
-rw-r--r--Source/SPBundleCommandRunner.m11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/SPBundleCommandRunner.m b/Source/SPBundleCommandRunner.m
index 2842ce4e..08fad6f1 100644
--- a/Source/SPBundleCommandRunner.m
+++ b/Source/SPBundleCommandRunner.m
@@ -30,6 +30,7 @@
#import "SPBundleCommandRunner.h"
#import "SPDatabaseDocument.h"
+#import "SPAppController.h"
// Defined to suppress warnings
@interface NSObject (SPBundleMethods)
@@ -91,11 +92,11 @@
[fm removeItemAtPath:scriptFilePath error:nil];
[fm removeItemAtPath:stdoutFilePath error:nil];
- if([[NSApp delegate] lastBundleBlobFilesDirectory] != nil)
- [fm removeItemAtPath:[[NSApp delegate] lastBundleBlobFilesDirectory] error:nil];
+ if([SPAppDelegate lastBundleBlobFilesDirectory] != nil)
+ [fm removeItemAtPath:[SPAppDelegate lastBundleBlobFilesDirectory] error:nil];
if([shellEnvironment objectForKey:SPBundleShellVariableBlobFileDirectory])
- [[NSApp delegate] setLastBundleBlobFilesDirectory:[shellEnvironment objectForKey:SPBundleShellVariableBlobFileDirectory]];
+ [SPAppDelegate setLastBundleBlobFilesDirectory:[shellEnvironment objectForKey:SPBundleShellVariableBlobFileDirectory]];
// Parse first line for magic header #! ; if found save the script content and run the command after #! with that file.
// This allows to write perl, ruby, osascript scripts natively.
@@ -218,7 +219,7 @@
// register command
pid = [bashTask processIdentifier];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:pid], @"pid",
- (contextInfo)?:[NSDictionary dictionary], @"contextInfo",
+ (contextInfo)?: @{}, @"contextInfo",
@"bashcommand", @"type",
[[NSDate date] descriptionWithCalendarFormat:@"%H:%M:%S" timeZone:nil locale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]], @"starttime",
nil];
@@ -296,7 +297,7 @@
// Read STDOUT saved to file
if([fm fileExistsAtPath:stdoutFilePath isDirectory:nil]) {
NSString *stdoutContent = [NSString stringWithContentsOfFile:stdoutFilePath encoding:NSUTF8StringEncoding error:nil];
- if(bashTask) [bashTask release], bashTask = nil;
+ if(bashTask) SPClear(bashTask);
[fm removeItemAtPath:stdoutFilePath error:nil];
if(stdoutContent != nil) {
if (status == 0) {