AcademySoftwareFoundation / rez

An integrated package configuration, build and deployment system for software
https://rez.readthedocs.io
Apache License 2.0
916 stars 328 forks source link

Using aliases in Powershell muffles exit code #1776

Open brycegbrazen opened 2 weeks ago

brycegbrazen commented 2 weeks ago

Running an alias using the Powershell shell plugin with rez-env doesn't return the correct exit code when running the command in-line.

Environment

To Reproduce

  1. Create a package.py for a test_alias package with the following definition:
    
    name = "test_alias"

version = "1.0.0"

build_command = ""

def commands(): alias('make_error', 'python')


2. Install the package to your package repository.
3. Run `rez-env python -c "raise"`
4. Observe $LASTEXITCODE as being 1 as expected.
5. Run `rez-env make_error -c "raise"`
6. Observe $LASTEXITCODE as being 0 instead of the correct value of 1.

**Expected behavior**
$LASTEXITCODE is 1.

**Actual behavior**
$LASTEXITCODE is 0.