aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPStringAdditions.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-11-21 19:42:42 +0000
committerBibiko <bibiko@eva.mpg.de>2010-11-21 19:42:42 +0000
commit79bf97de1dc30afb75a07958ff99b6f95473383e (patch)
treef789a43c40c6ff3f4c7868ba0115fc90926f8aea /Source/SPStringAdditions.m
parentecba7ac8da8f0f2728bf23815e9103b42ec81729 (diff)
downloadsequelpro-79bf97de1dc30afb75a07958ff99b6f95473383e.tar.gz
sequelpro-79bf97de1dc30afb75a07958ff99b6f95473383e.tar.bz2
sequelpro-79bf97de1dc30afb75a07958ff99b6f95473383e.zip
• added line numbering and current line highlighting to Bundle Editor's command text view
• made each Bundle in/ouptut file name unique to allow to run different Bundle commands at the same time • fixed minor issues for Bundle Editor
Diffstat (limited to 'Source/SPStringAdditions.m')
-rw-r--r--Source/SPStringAdditions.m9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m
index 816dc362..09f37866 100644
--- a/Source/SPStringAdditions.m
+++ b/Source/SPStringAdditions.m
@@ -421,7 +421,8 @@
NSMutableArray *scriptHeaderArguments = [NSMutableArray array];
NSString *scriptPath = @"";
- NSString *stdoutFilePath = @"/tmp/SP_BUNDLE_OUTPUT_FILE";
+ NSString *stdoutFilePath = [NSString stringWithFormat:@"/tmp/SP_BUNDLE_OUTPUT_FILE_%@", [NSString stringWithNewUUID]];
+ NSString *scriptFilePath = [NSString stringWithFormat:@"%@_%@", SPBundleTaskScriptCommandFilePath, [NSString stringWithNewUUID]];
[[NSFileManager defaultManager] removeItemAtPath:SPBundleTaskScriptCommandFilePath error:nil];
[[NSFileManager defaultManager] removeItemAtPath:stdoutFilePath error:nil];
@@ -443,10 +444,10 @@
if([scriptPath hasPrefix:@"/"] && [[NSFileManager defaultManager] fileExistsAtPath:scriptPath isDirectory:&isDir] && !isDir) {
NSString *script = [self substringWithRange:NSMakeRange(NSMaxRange(firstLineRange), [self length] - NSMaxRange(firstLineRange))];
NSError *writeError = nil;
- [script writeToFile:SPBundleTaskScriptCommandFilePath atomically:YES encoding:NSUTF8StringEncoding error:writeError];
+ [script writeToFile:scriptFilePath atomically:YES encoding:NSUTF8StringEncoding error:writeError];
if(writeError == nil) {
redirectForScript = YES;
- [scriptHeaderArguments addObject:SPBundleTaskScriptCommandFilePath];
+ [scriptHeaderArguments addObject:scriptFilePath];
} else {
NSBeep();
NSLog(@"Couldn't write script file.");
@@ -532,7 +533,7 @@
}
if(redirectForScript)
- [[NSFileManager defaultManager] removeItemAtPath:SPBundleTaskScriptCommandFilePath error:nil];
+ [[NSFileManager defaultManager] removeItemAtPath:scriptFilePath error:nil];
// If return from bash re-activate Sequel Pro
[NSApp activateIgnoringOtherApps:YES];