From 4425627703d593b483b0fcceaec6f9881e0e3c88 Mon Sep 17 00:00:00 2001 From: Paul Charmoille Date: Wed, 11 Dec 2024 17:28:49 +0100 Subject: [PATCH] fix(utils.execution): cmd file should exit with an error code This will allow file execution through another shell to catch the exit code. example: ```file.cmd color 00 ``` ``` cmd file.cmd echo %errorlevel% > 0 # instead of 1 ``` --- src/rez/utils/execution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rez/utils/execution.py b/src/rez/utils/execution.py index 2ae5e8052..529ca7be0 100644 --- a/src/rez/utils/execution.py +++ b/src/rez/utils/execution.py @@ -155,7 +155,7 @@ def create_executable_script(filepath, body, program=None, py_script_mode=None): # before yaml.load f.write("@echo off\n") f.write("%s.exe %%~dpnx0 %%*\n" % program) - f.write("goto :eof\n") # skip YAML body + f.write("exit /B %errorlevel%\n") f.write(":: YAML\n") # comment for human else: f.write("#!/usr/bin/env %s\n" % program)