diff options
| -rwxr-xr-x | build-openbsd-image.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/build-openbsd-image.sh b/build-openbsd-image.sh index 17f2145..faa6bc1 100755 --- a/build-openbsd-image.sh +++ b/build-openbsd-image.sh @@ -18,6 +18,20 @@ export PACKER_LOG=1 main() ( parse_args "$@" cd openbsd-image/ + if [ -d build/ ]; then + printf 'Build directory exists. Must delete before re-building. Proceed? (y/N)' + read -r answer + case $answer in + [yY]) + echo "Removing build/.." + rm -r build/ + ;; + *) + echo "Aborting.." + exit 0 + ;; + esac + fi packer init . packer build \ -only "qemu.openbsd-$ARCH" \ |