diff options
| author | Radon Rosborough <radon.neon@gmail.com> | 2022-01-05 15:35:12 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-05 15:35:12 -0800 |
| commit | 53f243b111b18f49d910d1501b5795a1ec045420 (patch) | |
| tree | 785538e39d04a00bc43507224f0ad6a4c89f297d /scripts/docker-run.bash | |
| parent | 41fa1f70ee01cd2ab3ab90f6fe4c4fc0819c2f96 (diff) | |
Add formatter tests (#72)
Closes #24
Builds on #25 by @PrimaryCanary
Diffstat (limited to 'scripts/docker-run.bash')
| -rwxr-xr-x | scripts/docker-run.bash | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/docker-run.bash b/scripts/docker-run.bash new file mode 100755 index 0000000..e7de1f4 --- /dev/null +++ b/scripts/docker-run.bash @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -euo pipefail + +repo="$(git rev-parse --show-toplevel)" + +docker=(docker) +if [[ "$OSTYPE" != darwin* ]] && [[ "$EUID" != 0 ]]; then + docker=(sudo -E "${docker[@]}") +fi + +it=() + +if [[ -t 0 ]]; then + it+=(-it) +fi + +exec "${docker[@]}" run "${it[@]}" --rm -v "${repo}:/src" \ + --entrypoint=/src/scripts/docker-pid1.bash "$@" |
