Skip to content

Commit

Permalink
fix: Packer don't reset stty properly
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel committed Dec 21, 2024
1 parent b8e2684 commit 53564bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hooks/packer_fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ for path in "${UNIQUE_PATHS[@]}"; do
pids+=("$!")
done

exec 3>&1 < /dev/tty > /dev/tty
tty_settings=$(stty -g)

error=0
exit_code=0
for pid in "${pids[@]}"; do
Expand All @@ -37,6 +40,8 @@ for pid in "${pids[@]}"; do
fi
done

stty "$tty_settings"

if [[ $error -ne 0 ]]; then
exit 1
fi

0 comments on commit 53564bf

Please sign in to comment.