file.sh 386 B

12345678910111213141516
  1. #!/usr/bin/env bash
  2. set -Eeuo pipefail
  3. # given an image (name:tag), return the appropriate filename
  4. dir="$(dirname "$BASH_SOURCE")"
  5. for img; do
  6. if [[ "$img" != *:* ]]; then
  7. echo >&2 "error: '$img' does not contain ':' -- this violates our assumptions! (did you mean '$img:latest' ?)"
  8. exit 1
  9. fi
  10. imgFile="$dir/${img/:/___}" # see ".external-pins/list.sh"
  11. echo "$imgFile"
  12. done