Repository: candlecorp/wick (language: rust)

Issue:
Can't install wick with any of the commands
**Describe the bug**
I tried to install wick and the first command, `cargo install wick-cli`, didn't work because I didn't have Rust installed on this system. The second command, `brew install candlecorp/tap/wick`, didn't work because I don't have homebrew installed on my macbook air. The third command `curl -sSL sh.wick.run | bash` errored out with 

```
Installing wick latest
This will install wick to ~/.wick/bin.



Sorry, there is no prebuilt binary for operating system and architecture: 'darwin-amd64'.



Failed to install wick.
You can try building a custom version from source at https://github.com/candlecorp/wick/
For support, go to https://candle.dev/, join our Discord https://discord.gg/candle or reach out to us on Twitter @candle_corp.
```

**To Reproduce**
Find a mac that isn't set up for development and run those install commands. The `homebrew` command won't work on windows either. It's probably not a good one to lead with.

**Expected behavior**
wick would install *somehow*

**Actual behavior**
Wick doesn't install.

**Environment:**
 - OS: macOS Venture Version 13.5.2 (22G91)
 - Architecture: 1.2 GHz Quad-Core Intel Core i7
 - Build Version: ??

**Additional context**
Add any other context about the problem here.

Can't install wick with any of the commands
**Describe the bug**
I tried to install wick and the first command, `cargo install wick-cli`, didn't work because I didn't have Rust installed on this system. The second command, `brew install candlecorp/tap/wick`, didn't work because I don't have homebrew installed on my macbook air. The third command `curl -sSL sh.wick.run | bash` errored out with 

```
Installing wick latest
This will install wick to ~/.wick/bin.



Sorry, there is no prebuilt binary for operating system and architecture: 'darwin-amd64'.



Failed to install wick.
You can try building a custom version from source at https://github.com/candlecorp/wick/
For support, go to https://candle.dev/, join our Discord https://discord.gg/candle or reach out to us on Twitter @candle_corp.
```

**To Reproduce**
Find a mac that isn't set up for development and run those install commands. The `homebrew` command won't work on windows either. It's probably not a good one to lead with.

**Expected behavior**
wick would install *somehow*

**Actual behavior**
Wick doesn't install.

**Environment:**
 - OS: macOS Venture Version 13.5.2 (22G91)
 - Architecture: 1.2 GHz Quad-Core Intel Core i7
 - Build Version: ??

**Additional context**
Add any other context about the problem here.



Discussion / hints:

Fix patch:
diff --git a/installer/setup.sh b/installer/setup.sh
index 7301d53d8..b57edbfd3 100755
--- a/installer/setup.sh
+++ b/installer/setup.sh
@@ -35,10 +35,15 @@
   ARCH=$(uname -m)
   OS=$(echo $(uname) | tr '[:upper:]' '[:lower:]')
 
-  # Apple silicon machines expose ARCH as "arm64"
-  if [ "$OS" = "darwin" -a "$ARCH" = "arm64" ]; then
+  SUCCESSFUL=false
+
+  # Change "darwin" to "macos" to match up with release tarballs
+  if [ "$OS" = "darwin" ]; then
     OS="macos"
-    ARCH="aarch64"
+    # Apple silicon machines expose ARCH as "arm64"
+    if [ "$ARCH" = "arm64" ]; then
+        ARCH="aarch64"
+    fi
   fi
 
   #change x86_64 to amd64
@@ -147,7 +152,7 @@
         exit 4
       fi
     done
-
+    SUCCESSFUL=true
   }
 
   separate_output() {
@@ -213,7 +218,9 @@
   }
 
   cleanup() {
-    if [[ -d "${TMP_ROOT:-}" ]]; then
+    if [[ "$SUCCESSFUL" == "false" ]]; then
+      echo "Installation failed. Any downloaded files remain in ${TMP_ROOT} to aid troubleshooting."
+    elif [[ -d "${TMP_ROOT:-}" ]]; then
       rm -rf "$TMP_ROOT"
     fi
   }


Test patch: