symbolicate

 1#!/usr/bin/env bash
 2
 3set -eu
 4if [[ $# -eq 0 ]] || [[ "$1" == "--help" ]]; then
 5  echo "Usage: $(basename $0) <path_to_ips_file>"
 6  echo "This script symbolicates the provided .ips file using the appropriate dSYM file from digital ocean"
 7  echo ""
 8  exit 1
 9fi
10
11ips_file=$1;
12
13version=$(cat $ips_file | head -n 1 | jq -r .app_version)
14bundle_id=$(cat $ips_file | head -n 1 | jq -r .bundleID)
15cpu_type=$(cat $ips_file | tail -n+2 | jq -r .cpuType)
16
17which symbolicate >/dev/null || cargo install symbolicate
18
19arch="x86_64-apple-darwin"
20if [[ "$cpu_type" == *ARM-64* ]]; then
21    arch="aarch64-apple-darwin"
22fi
23echo $bundle_id;
24
25channel="stable"
26if [[ "$bundle_id" == *Nightly* ]]; then
27    channel="nightly"
28elif [[ "$bundle_id" == *Preview* ]]; then
29    channel="preview"
30fi
31
32mkdir -p target/dsyms/$channel
33
34dsym="$channel/Zed-$version-$arch.dwarf"
35if [[ ! -f target/dsyms/$dsym ]]; then
36    echo "Downloading $dsym..."
37    curl -o target/dsyms/$dsym.gz "https://zed-debug-symbols.nyc3.digitaloceanspaces.com/$channel/Zed-$version-$arch.dwarf.gz"
38    gunzip  target/dsyms/$dsym.gz
39fi
40
41symbolicate $ips_file target/dsyms/$dsym