You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Compile-SourceScript/Public/Compile-SourceScript.ps1
+62-29Lines changed: 62 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,9 @@ function Compile-SourceScript {
61
61
62
62
# Initialize variables
63
63
$MOD=@{
64
+
# The sourcemod compiler returns exits code correctly.
65
+
# The sourcemod compiler wrapper returns the exit code of the lastmost executed shell statement. This is particularly bad when the compiler exits with '0' from a successful finalmost shell statement, even when one or more prior shell statements exited with non-zero exit codes.
66
+
# Hence, knowing that exit codes are not a reliable way to determine whether one or more compilation statements failed, we are going to use a regex on the stdout as a more reliable way to detect compilation errors, regardless of whether compilation was performed via the compiler binary or via the compiler wrapper.
64
67
sourcemod=@{
65
68
script_ext='.sp'
66
69
plugin_ext='.smx'
@@ -70,13 +73,18 @@ function Compile-SourceScript {
# The amxmodx compiler binary always exits with exit code 0.
86
+
# The amxmodx compiler wrapper always exits with exit code 0.
87
+
# Hence, knowing that exit codes are not a reliable way to determine whether one or more compilation statements failed, we are going to use a regex on the stdout as a more reliable way to detect compilation errors, regardless of whether compilation was performed via the compiler binary or via the compiler wrapper.
80
88
amxmodx=@{
81
89
script_ext='.sma'
82
90
plugin_ext='.amxx'
@@ -86,21 +94,18 @@ function Compile-SourceScript {
0 commit comments