File tree Expand file tree Collapse file tree 1 file changed +10
-22
lines changed Expand file tree Collapse file tree 1 file changed +10
-22
lines changed Original file line number Diff line number Diff line change 4848printf " Latest Parseable version: $release_tag \n"
4949
5050# Determine the appropriate binary prefix based on OS and CPU architecture
51- if [[ " $OS " == " darwin" ]]; then
52- if [[ " $CPU_ARCH " == " arm64" ]]; then
53- PARSEABLE_PREFIX=${ARM_APPLE_PREFIX}
54- elif [[ " $CPU_ARCH " == " x86_64" ]]; then
55- PARSEABLE_PREFIX=${INTEL_APPLE_PREFIX}
56- else
57- echo " Error: Unsupported CPU architecture for macOS (${CPU_ARCH} )."
58- exit 1
59- fi
60- elif [[ " $OS " == " linux" ]]; then
61- if [[ " $CPU_ARCH " == " arm64" ]]; then
62- PARSEABLE_PREFIX=${ARM_LINUX_PREFIX}
63- elif [[ " $CPU_ARCH " == " x86_64" ]]; then
64- PARSEABLE_PREFIX=${INTEL_LINUX_PREFIX}
65- else
66- echo " Error: Unsupported CPU architecture for Linux (${CPU_ARCH} )."
67- exit 1
68- fi
69- else
70- echo " Error: Unsupported operating system (${OS} )."
71- exit 1
72- fi
51+ declare -A PREFIX_MAP=(
52+ [" darwin_arm64" ]=$ARM_APPLE_PREFIX
53+ [" darwin_x86_64" ]=$INTEL_APPLE_PREFIX
54+ [" linux_arm64" ]=$ARM_LINUX_PREFIX
55+ [" linux_x86_64" ]=$INTEL_LINUX_PREFIX
56+ )
57+ key=" ${OS} _${CPU_ARCH} "
58+ PARSEABLE_PREFIX=${PREFIX_MAP[$key]:- " " } || {
59+ echo " Error: unsupported platform $OS /$CPU_ARCH " ; exit 1;
60+ }
7361
7462download_url=${DOWNLOAD_BASE_URL} /${release_tag} /${PARSEABLE_PREFIX}
7563
You can’t perform that action at this time.
0 commit comments