@@ -70,6 +70,7 @@ private async void Compile_SPScripts(bool compileAll = true)
7070 var SpCompFound = false ;
7171 var PressedEscape = false ;
7272 var hadError = false ;
73+ var dontCreateFile = false ;
7374 TotalErrors = 0 ;
7475 TotalWarnings = 0 ;
7576 CurrentErrorString = string . Empty ;
@@ -172,11 +173,24 @@ await this.ShowMessageAsync(Translate("Error"),
172173 process . StartInfo . CreateNoWindow = true ;
173174 process . StartInfo . FileName = spCompInfo . FullName ;
174175
175- var destinationFileName = ShortenScriptFileName ( fileInfo . Name ) + ".smx" ;
176- var outFile = Path . Combine ( fileInfo . DirectoryName , destinationFileName ) ;
177- if ( File . Exists ( outFile ) )
176+ dontCreateFile = ee . DontCreateFileBox . IsChecked . HasValue && ee . DontCreateFileBox . IsChecked . Value ;
177+ string outFile ;
178+ string destinationFileName ;
179+ if ( dontCreateFile )
178180 {
179- File . Delete ( outFile ) ;
181+ outFile = "NUL" ;
182+ destinationFileName = string . Empty ;
183+ }
184+ else
185+ {
186+ destinationFileName = ShortenScriptFileName ( fileInfo . Name ) + ".smx" ;
187+ outFile = Path . Combine ( fileInfo . DirectoryName , destinationFileName ) ;
188+ if ( File . Exists ( outFile ) )
189+ {
190+ File . Delete ( outFile ) ;
191+ }
192+ ExecuteCommandLine ( currentConfig . PreCmd , fileInfo . DirectoryName , currentConfig . CopyDirectory ,
193+ fileInfo . FullName , fileInfo . Name , outFile , destinationFileName ) ;
180194 }
181195
182196 var errorFile = $@ "{ fileInfo . DirectoryName } \error_{ Environment . TickCount } _{ file . GetHashCode ( ) : X} _{ i } .txt";
@@ -197,8 +211,7 @@ await this.ShowMessageAsync(Translate("Error"),
197211 "\" " + fileInfo . FullName + "\" -o=\" " + outFile + "\" -e=\" " + errorFile + "\" " +
198212 includeStr + " -O=" + currentConfig . OptimizeLevel + " -v=" + currentConfig . VerboseLevel ;
199213 ProgressTask . SetProgress ( ( i + 1 - 0.5d ) / compileCount ) ;
200- var execResult = ExecuteCommandLine ( currentConfig . PreCmd , fileInfo . DirectoryName , currentConfig . CopyDirectory ,
201- fileInfo . FullName , fileInfo . Name , outFile , destinationFileName ) ;
214+
202215
203216 ProcessUITasks ( ) ;
204217
@@ -212,7 +225,7 @@ await this.ShowMessageAsync(Translate("Error"),
212225 await ProgressTask . CloseAsync ( ) ;
213226 await this . ShowMessageAsync ( Translate ( "Error" ) ,
214227 "The SourcePawn compiler has crashed.\n " +
215- "Try again, or file an issue at the SourcePawn GitHub repository describing your steps that lead to this instance in detail.\n " +
228+ "Try again, or file an issue at the SourcePawn GitHub repository describing your steps that led to this instance in detail.\n " +
216229 $ "Exit code: { process . ExitCode : X} ", MessageDialogStyle . Affirmative ,
217230 MetroDialogOptions ) ;
218231 LoggingControl . LogAction ( $ "Compiler crash detected, file: { fileInfo . Name } ", 2 ) ;
@@ -286,15 +299,18 @@ await this.ShowMessageAsync(Translate("SPCompNotStarted"),
286299 compiledSuccess ++ ;
287300 }
288301
289- if ( File . Exists ( outFile ) )
302+ if ( ! dontCreateFile && File . Exists ( outFile ) )
290303 {
291304 CompiledFiles . Add ( outFile ) ;
292305 NonUploadedFiles . Add ( outFile ) ;
293306 CompiledFileNames . Add ( destinationFileName ) ;
294307 }
295308
296- var execResult_Post = ExecuteCommandLine ( currentConfig . PostCmd , fileInfo . DirectoryName ,
297- currentConfig . CopyDirectory , fileInfo . FullName , fileInfo . Name , outFile , destinationFileName ) ;
309+ if ( ! dontCreateFile )
310+ {
311+ ExecuteCommandLine ( currentConfig . PostCmd , fileInfo . DirectoryName ,
312+ currentConfig . CopyDirectory , fileInfo . FullName , fileInfo . Name , outFile , destinationFileName ) ;
313+ }
298314
299315 ProgressTask . SetProgress ( ( double ) ( i + 1 ) / compileCount ) ;
300316 ProcessUITasks ( ) ;
@@ -312,23 +328,23 @@ await this.ShowMessageAsync(Translate("SPCompNotStarted"),
312328 if ( ! PressedEscape )
313329 {
314330 ProgressTask . SetProgress ( 1.0 ) ;
315- if ( currentConfig . AutoCopy )
331+ if ( currentConfig . AutoCopy && ! dontCreateFile )
316332 {
317333 ProgressTask . SetTitle ( Translate ( "CopyingFiles" ) + "..." ) ;
318334 ProgressTask . SetIndeterminate ( ) ;
319335 await Task . Run ( ( ) => Copy_Plugins ( ) ) ;
320336 ProgressTask . SetProgress ( 1.0 ) ;
321337 }
322338
323- if ( currentConfig . AutoUpload )
339+ if ( currentConfig . AutoUpload && ! dontCreateFile )
324340 {
325341 ProgressTask . SetTitle ( Translate ( "FTPUploading" ) + "..." ) ;
326342 ProgressTask . SetIndeterminate ( ) ;
327343 await Task . Run ( FTPUpload_Plugins ) ;
328344 ProgressTask . SetProgress ( 1.0 ) ;
329345 }
330346
331- if ( currentConfig . AutoRCON )
347+ if ( currentConfig . AutoRCON && ! dontCreateFile )
332348 {
333349 ProgressTask . SetTitle ( Translate ( "RCONCommand" ) + "..." ) ;
334350 ProgressTask . SetIndeterminate ( ) ;
0 commit comments