@@ -116,10 +116,11 @@ def publish_engine_py(dirs):
116
116
try :
117
117
copy_python_files (dirs .repository_root_dir , dirs .engine_build_dir )
118
118
119
- output = subprocess .run (f'{ dirs .python_path } -m compileall { dirs .engine_build_dir } ' , shell = True , capture_output = True )
120
- if output .stderr :
119
+ try :
120
+ output = subprocess .run (f'{ dirs .python_path } -m compileall { dirs .engine_build_dir } ' , shell = True , capture_output = True , check = True )
121
+ except subprocess .CalledProcessError as e :
121
122
print ("Build failed!" )
122
- print (output .stderr )
123
+ print (e .stderr )
123
124
sys .exit (- 1 )
124
125
125
126
stdout = str (output .stdout )
@@ -163,15 +164,17 @@ def publish_dotnet_apps(dirs, configuration, dotnet_package_source):
163
164
restore_args = f"dotnet restore \" { proj_file_path } \" --use-lock-file --locked-mode --force"
164
165
if dotnet_package_source is not None :
165
166
restore_args = f"{ restore_args } -s { dotnet_package_source } "
166
- output = subprocess .run (restore_args , shell = True , stderr = subprocess .PIPE )
167
- if output .stderr :
167
+ try :
168
+ subprocess .run (restore_args , shell = True , stderr = subprocess .PIPE , check = True )
169
+ except subprocess .CalledProcessError as e :
168
170
print ("Build failed!" )
169
- print (str (output .stderr ))
171
+ print (str (e .stderr ))
170
172
sys .exit (- 1 )
171
- output = subprocess .run (f"dotnet publish \" { proj_file_path } \" --no-restore -o \" { proj_output_dir } \" -c { configuration } -f netcoreapp5.0" , shell = True , stderr = subprocess .PIPE )
172
- if output .stderr :
173
+ try :
174
+ subprocess .run (f"dotnet publish \" { proj_file_path } \" --no-restore -o \" { proj_output_dir } \" -c { configuration } -f netcoreapp5.0" , shell = True , stderr = subprocess .PIPE , check = True )
175
+ except subprocess .CalledProcessError as e :
173
176
print ("Build failed!" )
174
- print (str (output .stderr ))
177
+ print (str (e .stderr ))
175
178
sys .exit (- 1 )
176
179
177
180
if __name__ == '__main__' :
0 commit comments