-
Notifications
You must be signed in to change notification settings - Fork 2
/
install-macos.sh
executable file
·31 lines (26 loc) · 1.01 KB
/
install-macos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
set -e
if [[ -d /Applications/SynthetixNode.app ]]; then
echo "SynthetixNode.app installed in /Applications"
open /Applications/SynthetixNode.app
exit 0
fi
ARCH=$(uname -m)
# Check if the system is running on ARM or x86_64 architecture
if [ "$ARCH" = "arm64" ]; then
DOWNLOAD_URL="https://github.com/Synthetixio/synthetix-node/releases/latest/download/SynthetixNode-mac-arm64.zip"
elif [ "$ARCH" = "x86_64" ]; then
DOWNLOAD_URL="https://github.com/Synthetixio/synthetix-node/releases/latest/download/SynthetixNode-mac-x64.zip"
else
echo "Unsupported architecture $ARCH"
exit 1
fi
echo "Downloading from $DOWNLOAD_URL..."
curl --location --output SynthetixNode.zip --url $DOWNLOAD_URL
unzip -q SynthetixNode.zip
rm SynthetixNode.zip
# When using curl to download a file, macOS will NOT add a quarantine attribute to the file.
# xattr -d com.apple.quarantine SynthetixNode.app
mv -v ./SynthetixNode.app /Applications
echo "SynthetixNode.app installed in /Applications"
open /Applications/SynthetixNode.app