16 lines
587 B
Bash
Executable File
16 lines
587 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Disposable Arch container for testing the installer without touching the host.
|
|
# Usage:
|
|
# ./docker/test.sh # interactive shell, deps installed
|
|
# ./docker/test.sh "npx tsc --noEmit" # run one command non-interactively
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
docker build -t dotfiles-test -f docker/Dockerfile .
|
|
|
|
tty_flags=(-i)
|
|
[ -t 0 ] && [ -t 1 ] && tty_flags+=(-t)
|
|
|
|
docker run --rm "${tty_flags[@]}" -v "$PWD":/src:ro dotfiles-test \
|
|
bash -lc 'cp -r /src ~/DotFiles && cd ~/DotFiles && npm install && exec bash -c "$1"' -- "${1:-bash}"
|