fix tliam script not exit code failing on fail

This commit is contained in:
Shelvacu
2024-11-23 15:35:30 -08:00
parent 7b019ef9f3
commit 33dccc1c8f

14
tliam
View File

@@ -1,11 +1,19 @@
#!/bin/sh
#!/usr/bin/env bash
set -e
git add .
declare -a cmd
if [ "$HOST" = "triple-dezert" ]; then
nix run .'#'checks.x86_64-linux.liam.driver -- "$@" && echo "SUCCESS" || echo "FAIL"
cmd=(nix run .'#'checks.x86_64-linux.liam.driver -- "$@")
else
nix copy -v .'#'checks.x86_64-linux.liam.driver --to ssh://trip
ssh trip -- sudo "$(nix path-info .'#'checks.x86_64-linux.liam.driver)/bin/nixos-test-driver" "$@" && echo "SUCCESS" || echo "FAIL"
cmd=(ssh trip -- sudo "$(nix path-info .'#'checks.x86_64-linux.liam.driver)/bin/nixos-test-driver" "$@")
fi
if "${cmd[@]}"; then
echo "SUCCESS"
else
echo "FAIL"
exit 1
fi