From 71ba9fb7b5bf6b071d90f234a608ec253cec2277 Mon Sep 17 00:00:00 2001
From: Rafael dos Santos Silva <xfalcox@gmail.com>
Date: Mon, 18 Apr 2022 18:34:53 -0300
Subject: [PATCH] Always pull image on arm

---
 launcher | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/launcher b/launcher
index fffe815..59d358a 100755
--- a/launcher
+++ b/launcher
@@ -198,7 +198,8 @@ check_prereqs() {
     echo "WARNING: Docker version ${test} deprecated, recommend upgrade to ${docker_rec_version} or newer."
   fi
 
-  case `uname -m` in
+  arm=false
+  case $(uname -m) in
     armv7l)
       echo "ERROR: 32bit arm is not supported. Check if your hardware support arm64, which is supported in experimental capacity."
       exit 1
@@ -206,6 +207,7 @@ check_prereqs() {
     aarch64 | arm64)
       echo "WARNING: Support for aarch64 is experimental at the moment. Please report any problems at https://meta.discourse.org/tag/arm "
       image="discourse/base:aarch64"
+      arm=true
       read -n 1 -s -r -p "Press any key to continue"
       ;;
     x86_64)
@@ -221,7 +223,8 @@ check_prereqs() {
   # 4. discourse docker image is downloaded
   test=`$docker_path images | awk '{print $1 ":" $2 }' | grep "$image"`
 
-  if [ -z "$test" ]; then
+  # arm experimental support is on a fixed tag, always pull
+  if [ -z "$test" ] || [ $arm = true ]; then
     echo
     echo "WARNING: We are about to start downloading the Discourse base image"
     echo "This process may take anywhere between a few minutes to an hour, depending on your network speed"
-- 
2.25.1