Skip to content

Commit 6a56e3c

Browse files
committed
update demo script
1 parent be7b92f commit 6a56e3c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

generate_demo.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@
22

33
set -euo pipefail
44

5+
# Uses https://github.com/charmbracelet/freeze/pull/113
6+
freeze_path="${FREEZE:-freeze}"
7+
trunk_path=../trunk/bazel-bin/trunk/cli/cli
8+
59
function freeze_linter() {
6-
freeze --theme=dracula -o "${2}" --execute "bash -c 'echo $ ${1}; ${1} || true'"
10+
${freeze_path} --theme=catppuccin-mocha --execute-non-zero -o "${2}" --execute "bash -c 'echo $ ${1}; ${1}'"
711
}
812

913
function freeze_trunk() {
10-
freeze --theme=dracula -o "${2/tb/trunk}" --execute "bash -c '${1} --no-progress --show-existing'"
14+
# freeze does not support ending with an ANSI escape code, so add empty text
15+
# Also modify the color codes to work better for freeze's themes.
16+
${freeze_path} --theme=catppuccin-mocha --execute-non-zero -o "${2}" --execute "bash -c 'echo $ ${1/${trunk_path}/trunk}; ${1} --no-progress --show-existing --upstream=false | sed s/✖/x/ | sed s/30m/104m/; echo -n \" \"'"
1117
}
1218

1319
mkdir -p screenshots
1420

1521
# Requires a pre-release version of Trunk
16-
tb=../trunk/bazel-bin/trunk/cli/cli
17-
freeze_trunk "${tb} check --filter=markdownlint test_data.md" "screenshots/markdownlint_trunk.png"
22+
freeze_trunk "${trunk_path} check --filter=markdownlint test_data.md" "screenshots/markdownlint_trunk.png"
1823
freeze_linter ".trunk/tools/markdownlint -r markdownlint-rule-search-replace test_data.md" "screenshots/markdownlint.png"
1924

2025
freeze_trunk "trunk check --filter=cspell test_data.md" "screenshots/cspell_trunk.png"

0 commit comments

Comments
 (0)