@@ -70,6 +70,7 @@ private async void Compile_SPScripts(bool compileAll = true)
70
70
var SpCompFound = false ;
71
71
var PressedEscape = false ;
72
72
var hadError = false ;
73
+ var dontCreateFile = false ;
73
74
TotalErrors = 0 ;
74
75
TotalWarnings = 0 ;
75
76
CurrentErrorString = string . Empty ;
@@ -172,11 +173,24 @@ await this.ShowMessageAsync(Translate("Error"),
172
173
process . StartInfo . CreateNoWindow = true ;
173
174
process . StartInfo . FileName = spCompInfo . FullName ;
174
175
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 )
178
180
{
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 ) ;
180
194
}
181
195
182
196
var errorFile = $@ "{ fileInfo . DirectoryName } \error_{ Environment . TickCount } _{ file . GetHashCode ( ) : X} _{ i } .txt";
@@ -197,8 +211,7 @@ await this.ShowMessageAsync(Translate("Error"),
197
211
"\" " + fileInfo . FullName + "\" -o=\" " + outFile + "\" -e=\" " + errorFile + "\" " +
198
212
includeStr + " -O=" + currentConfig . OptimizeLevel + " -v=" + currentConfig . VerboseLevel ;
199
213
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
+
202
215
203
216
ProcessUITasks ( ) ;
204
217
@@ -212,7 +225,7 @@ await this.ShowMessageAsync(Translate("Error"),
212
225
await ProgressTask . CloseAsync ( ) ;
213
226
await this . ShowMessageAsync ( Translate ( "Error" ) ,
214
227
"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 " +
216
229
$ "Exit code: { process . ExitCode : X} ", MessageDialogStyle . Affirmative ,
217
230
MetroDialogOptions ) ;
218
231
LoggingControl . LogAction ( $ "Compiler crash detected, file: { fileInfo . Name } ", 2 ) ;
@@ -286,15 +299,18 @@ await this.ShowMessageAsync(Translate("SPCompNotStarted"),
286
299
compiledSuccess ++ ;
287
300
}
288
301
289
- if ( File . Exists ( outFile ) )
302
+ if ( ! dontCreateFile && File . Exists ( outFile ) )
290
303
{
291
304
CompiledFiles . Add ( outFile ) ;
292
305
NonUploadedFiles . Add ( outFile ) ;
293
306
CompiledFileNames . Add ( destinationFileName ) ;
294
307
}
295
308
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
+ }
298
314
299
315
ProgressTask . SetProgress ( ( double ) ( i + 1 ) / compileCount ) ;
300
316
ProcessUITasks ( ) ;
@@ -312,23 +328,23 @@ await this.ShowMessageAsync(Translate("SPCompNotStarted"),
312
328
if ( ! PressedEscape )
313
329
{
314
330
ProgressTask . SetProgress ( 1.0 ) ;
315
- if ( currentConfig . AutoCopy )
331
+ if ( currentConfig . AutoCopy && ! dontCreateFile )
316
332
{
317
333
ProgressTask . SetTitle ( Translate ( "CopyingFiles" ) + "..." ) ;
318
334
ProgressTask . SetIndeterminate ( ) ;
319
335
await Task . Run ( ( ) => Copy_Plugins ( ) ) ;
320
336
ProgressTask . SetProgress ( 1.0 ) ;
321
337
}
322
338
323
- if ( currentConfig . AutoUpload )
339
+ if ( currentConfig . AutoUpload && ! dontCreateFile )
324
340
{
325
341
ProgressTask . SetTitle ( Translate ( "FTPUploading" ) + "..." ) ;
326
342
ProgressTask . SetIndeterminate ( ) ;
327
343
await Task . Run ( FTPUpload_Plugins ) ;
328
344
ProgressTask . SetProgress ( 1.0 ) ;
329
345
}
330
346
331
- if ( currentConfig . AutoRCON )
347
+ if ( currentConfig . AutoRCON && ! dontCreateFile )
332
348
{
333
349
ProgressTask . SetTitle ( Translate ( "RCONCommand" ) + "..." ) ;
334
350
ProgressTask . SetIndeterminate ( ) ;
0 commit comments