mach: fix exit status on NixOS (#30079)

This commit is contained in:
Delan Azabani 2023-08-08 17:09:27 +08:00 committed by GitHub
parent 2fe0413b72
commit 048ca7806b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

3
mach
View file

@ -40,7 +40,8 @@ if __name__ == '__main__':
print('NOTE: Entering nix-shell etc/shell.nix')
try:
# sys argv already contains the ./mach part, so we just need to pass it as-is
subprocess.Popen(['nix-shell', mach_dir + '/etc/shell.nix', '--run', ' '.join(map(quote, sys.argv))]).wait()
result = subprocess.run(['nix-shell', mach_dir + '/etc/shell.nix', '--run', ' '.join(map(quote, sys.argv))])
sys.exit(result.returncode)
except KeyboardInterrupt:
sys.exit(0)
else: