From c95843df8d160cfb025eaf7bea542ba525d90927 Mon Sep 17 00:00:00 2001 From: Charles Augello Date: Fri, 24 Jan 2025 14:56:28 -0500 Subject: [PATCH] Bubble up failures in dotfiles installation Currently, if the dotfiles installation (`coder dotfiles ...`) fails, the script still shows as successful in the Coder UI. --- dotfiles/run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dotfiles/run.sh b/dotfiles/run.sh index 9463439..2f212db 100644 --- a/dotfiles/run.sh +++ b/dotfiles/run.sh @@ -20,4 +20,7 @@ if [ -n "$${DOTFILES_URI// }" ]; then DOTFILES_USER_HOME=$(eval echo ~"$DOTFILES_USER") sudo -u "$DOTFILES_USER" sh -c "'$CODER_BIN' dotfiles '$DOTFILES_URI' -y 2>&1 | tee '$DOTFILES_USER_HOME'/.dotfiles.log" fi + if [ $? -ne 0 ]; then + echo "Failed to install dotfiles" + exit 1 fi