forked from jovezhong/sling-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprep.mac.sh
32 lines (28 loc) · 1007 Bytes
/
prep.mac.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
32
set -e
# Configure private token
git config --global url."https://${GITHUB_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
# Check if MC is already available
if ! command -v mc &> /dev/null
then
echo "MC not found in path. Downloading..."
name=$(uname -s | tr "[:upper:]" "[:lower:]")
wget "https://dl.min.io/client/mc/release/$name-amd64/mc" && chmod +x mc
echo "$PWD" >> $GITHUB_PATH
export PATH=$PATH:$PWD
else
echo "MC already in path"
fi
# Determine the architecture
ARCH=$(uname -m)
if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
echo "Detected ARM64 architecture"
mc cp R2/sling/bin/sling_prep/sling_prep_darwin_arm64 . && chmod +x sling_prep_darwin_arm64
./sling_prep_darwin_arm64
elif [ "$ARCH" = "x86_64" ]; then
echo "Detected x86_64 architecture"
mc cp R2/sling/bin/sling_prep/sling_prep_darwin_amd64 . && chmod +x sling_prep_darwin_amd64
./sling_prep_darwin_amd64
else
echo "Unsupported architecture: $ARCH"
exit 1
fi