From 0624ac5a7426bb375b10fcee5933650c4c7cf7c9 Mon Sep 17 00:00:00 2001
From: Nick Sweeting <git@sweeting.me>
Date: Fri, 23 Apr 2021 23:56:55 -0400
Subject: [PATCH] try docker in setup script before anything else

---
 bin/setup.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/setup.sh b/bin/setup.sh
index 1fe284f5..cf06701c 100755
--- a/bin/setup.sh
+++ b/bin/setup.sh
@@ -3,6 +3,14 @@
 # Usage:
 #    curl 'https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/dev/bin/setup.sh' | sh
 
+if (which docker > /dev/null && docker pull archivebox/archivebox); then
+    echo "[+] Initializing an ArchiveBox data folder at ~/archivebox using Docker..."
+    mkdir -p ~/archivebox
+    cd ~/archivebox
+    docker run -v "$PWD":/data -it archivebox init --setup
+    exit 0
+fi
+
 echo "[!] It's highly recommended to use Docker instead of running this script. ⚠️"
 echo "    Docker is safer and easier to set up, and includes everything working out-of-the-box:"
 echo "        https://github.com/ArchiveBox/ArchiveBox/wiki/Docker"