max / alloy
- Co-Authored-By
- Claude Opus 5 (1M context) <noreply@anthropic.com>
1 file changed,
+14 insertions,
-1 deletion
| @@ -64,7 +64,20 @@ | |||
| 64 | 64 | [ "$reply" = "$DEVICE" ] || die "confirmation did not match; not writing" | |
| 65 | 65 | ||
| 66 | 66 | echo "==> Writing $ARTIFACT to $DEVICE" | |
| 67 | - | sudo dd if="$ARTIFACT" of="$DEVICE" bs=4M oflag=direct conv=fsync status=progress | |
| 67 | + | # `status=progress` redraws one line with carriage returns, which is what a | |
| 68 | + | # person watching a five-gigabyte write wants and exactly wrong for anything | |
| 69 | + | # that keeps what it is given. A log, a pipe or an agent's transcript has no | |
| 70 | + | # cursor to move, so every update is retained and the write arrives as a single | |
| 71 | + | # line thousands of characters long with the useful part at the far end. | |
| 72 | + | # | |
| 73 | + | # So the progress goes to a terminal and nowhere else. Without one, dd's default | |
| 74 | + | # still prints the transfer summary once, at the end, which is the whole of what | |
| 75 | + | # a log wants from it. Checked on stderr because that is where dd writes both. | |
| 76 | + | if [ -t 2 ]; then | |
| 77 | + | sudo dd if="$ARTIFACT" of="$DEVICE" bs=4M oflag=direct conv=fsync status=progress | |
| 78 | + | else | |
| 79 | + | sudo dd if="$ARTIFACT" of="$DEVICE" bs=4M oflag=direct conv=fsync | |
| 80 | + | fi | |
| 68 | 81 | sync | |
| 69 | 82 | ||
| 70 | 83 | # Verify, because dd reporting success is not evidence the bytes landed. |