Skip to content

Commit 701165a

Browse files
committed
Fix bugs
Allow processing of blank files Fix "Encapsulated" folder name
1 parent 93c3271 commit 701165a

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

VBScript/Build.vbs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ Const UseSystemDefault = -2
349349
Const adVarChar = 200
350350
Const adOpenStatic = 3
351351

352-
arrSubfolderNames = Array("01_Overall_Script_Header", "02_Upfront_Encapsualed_Code_With_No_Dependencies", "03_Main_Section_Code_Executed_Every_Time", "04_Later_Encapsulated_Code_With_Dependencies_on_Main", "05_Script_Footer")
352+
arrSubfolderNames = Array("01_Overall_Script_Header", "02_Upfront_Encapsulated_Code_With_No_Dependencies", "03_Main_Section_Code_Executed_Every_Time", "04_Later_Encapsulated_Code_With_Dependencies_on_Main", "05_Script_Footer")
353353
strOutputFileName = "Accelerator.vbs"
354354

355355
strOutput = ""
@@ -392,12 +392,21 @@ Else
392392
strTextFile = ""
393393
' WScript.Echo objADODBRecordSet.Fields("FilePath")
394394
Set objTextStreamFile = objFileSystemObject.OpenTextFile(objADODBRecordSet.Fields("FilePath"), ForReading, False, ASCII)
395+
On Error Resume Next
395396
strTextFile = objTextStreamFile.ReadAll
396-
objTextStreamFile.Close
397-
If strOutput = "" Then
398-
strOutput = strTextFile
397+
If Err Then
398+
On Error Goto 0
399+
strTextFile = ""
399400
Else
400-
strOutput = strOutput & vbCrLf & strTextFile
401+
On Error Goto 0
402+
End If
403+
objTextStreamFile.Close
404+
If strTextFile <> "" Then
405+
If strOutput = "" Then
406+
strOutput = strTextFile
407+
Else
408+
strOutput = strOutput & vbCrLf & strTextFile
409+
End If
401410
End If
402411
objADODBRecordSet.MoveNext
403412
Loop

0 commit comments

Comments
 (0)