From c178775a335d5e6292088c4c692f53832a129fd3 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 16 Nov 2010 12:09:44 +0000 Subject: =?UTF-8?q?=E2=80=A2=20Bundle=20support=20-=20further=20simplifica?= =?UTF-8?q?tions=20and=20centralizations=20-=20runBashCommandWithEnvironme?= =?UTF-8?q?nt:=20now=20it=20can=20execute=20each=20script=20command=20whos?= =?UTF-8?q?e=20first=20line=20begins=20with=20#!/...=20natively=20-=20adde?= =?UTF-8?q?d=20some=20more=20shell=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPCopyTable.m | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'Source/SPCopyTable.m') diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 84c43640..5574ff33 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -748,39 +748,8 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; [env setObject:[infoPath stringByDeletingLastPathComponent] forKey:@"SP_BUNDLE_PATH"]; [env setObject:SPBundleTaskInputFilePath forKey:@"SP_BUNDLE_INPUT_FILE"]; - id tablesListInstance = [[self delegate] valueForKeyPath:@"tablesListInstance"]; - id tableDocumentInstance = [[self delegate] valueForKeyPath:@"tableDocumentInstance"]; - - if (tablesListInstance) { - if([tablesListInstance selectedDatabase]) - [env setObject:[tablesListInstance selectedDatabase] forKey:@"SP_SELECTED_DATABASE"]; - - if ([tablesListInstance allDatabaseNames]) - [env setObject:[[tablesListInstance allDatabaseNames] componentsJoinedBySpacesAndQuoted] forKey:@"SP_ALL_DATABASES"]; - - if ([tablesListInstance allTableNames]) - [env setObject:[[tablesListInstance allTableNames] componentsJoinedBySpacesAndQuoted] forKey:@"SP_ALL_TABLES"]; - - if ([tablesListInstance allViewNames]) - [env setObject:[[tablesListInstance allViewNames] componentsJoinedBySpacesAndQuoted] forKey:@"SP_ALL_VIEWS"]; - - if ([tablesListInstance allFunctionNames]) - [env setObject:[[tablesListInstance allFunctionNames] componentsJoinedBySpacesAndQuoted] forKey:@"SP_ALL_FUNCTIONS"]; - - if ([tablesListInstance allProcedureNames]) - [env setObject:[[tablesListInstance allProcedureNames] componentsJoinedBySpacesAndQuoted] forKey:@"SP_ALL_PROCEDURES"]; - - if ([tablesListInstance tableName]) - [env setObject:[tablesListInstance tableName] forKey:@"SP_SELECTED_TABLE"]; - - } - - if(tableDocumentInstance && [tableDocumentInstance mySQLVersion]) - [env setObject:[tableDocumentInstance mySQLVersion] forKey:@"SP_RDBMS_VERSION"]; - - if(1) - [env setObject:@"mysql" forKey:@"SP_RDBMS_TYPE"]; - + if([[self delegate] respondsToSelector:@selector(usedQuery)] && [[self delegate] usedQuery]) + [env setObject:[[self delegate] usedQuery] forKey:@"SP_USED_QUERY_FOR_TABLE"]; // NSError *inputFileError = nil; // NSString *input = [NSString stringWithString:[[self string] substringWithRange:replaceRange]]; @@ -801,7 +770,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; [[NSFileManager defaultManager] removeItemAtPath:SPBundleTaskInputFilePath error:nil]; - if(err == nil && [cmdData objectForKey:SPBundleFileOutputActionKey]) { + if(err == nil && output && [cmdData objectForKey:SPBundleFileOutputActionKey]) { if([[cmdData objectForKey:SPBundleFileOutputActionKey] length] && ![[cmdData objectForKey:SPBundleFileOutputActionKey] isEqualToString:SPBundleOutputActionNone]) { NSString *action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; -- cgit v1.2.3