Skip to content

Commit 72833c7

Browse files
committed
try_input.sh: Add a Docker build step
To ensure that the bat-test image is available. Plus $PWD determinism so I can run it from anywhere.
1 parent 4f8d1bb commit 72833c7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/try_input.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
# $ scripts/try_input.sh < <HELP_MSG_FILE>
88
# $ pbpaste | scripts/try_input.sh
99

10+
set -euo pipefail
11+
12+
# change dir to scripts/
13+
cd "$(dirname "${BASH_SOURCE[0]}")"
14+
15+
echo "building docker image ..."
16+
docker build -f ../tests/docker/bat-test.dockerfile -t bat-test .. &> /dev/null
17+
printf '\e[A\e[K' # clear previous line
18+
image_id=$(docker image inspect --format "{{.Id}}" bat-test)
19+
echo "using docker image $image_id"
20+
1021
bat_options=(--no-config --plain --language=cmd-help --force-colorization)
1122

1223
cat |

0 commit comments

Comments
 (0)