Skip to content

Commit 875dcb4

Browse files
committed
Fix edge case around "bashbrew from" failing to create Git cache
1 parent 7d8e6d5 commit 875dcb4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/github-actions/generate.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ eval "${GENERATE_STACKBREW_LIBRARY:-./generate-stackbrew-library.sh}" > "$BASHBR
2929
# if we don't appear to be able to fetch the listed commits, they might live in a PR branch, so we should force them into the Bashbrew cache directly to allow it to do what it needs
3030
if ! bashbrew from "$image" &> /dev/null; then
3131
bashbrewGit="${BASHBREW_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/bashbrew}/git"
32+
if [ ! -d "$bashbrewGit" ]; then
33+
# if we're here, it's because "bashbrew from" failed so our cache directory might not have been created
34+
bashbrew from https://github.com/docker-library/official-images/raw/HEAD/library/hello-world:latest > /dev/null
35+
fi
3236
git -C "$bashbrewGit" fetch --quiet --update-shallow "$PWD" HEAD > /dev/null
3337
bashbrew from "$image" > /dev/null
3438
fi

0 commit comments

Comments
 (0)