forked from monginadiana/italanta-apps
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemulator-data.sh
executable file
·29 lines (23 loc) · 906 Bytes
/
emulator-data.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
#!/bin/bash
filename="emulator-data.zip"
fileurl="https://firebasestorage.googleapis.com/v0/b/elewa-clm-test.appspot.com/o/emulator-data%2Femulator-data.zip?alt=media&token=ebb5e830-f478-4378-ab59-8ba58daf2bf9"
# Download the zipped emulator data file
curl -o emulator-data.zip "$fileurl"
# Create a directory to extract the contents
target_dir="."
mkdir -p "$target_dir"
# Extract the contents of the zip file
if command -v bsdtar >/dev/null; then
bsdtar -xf "$filename" -C "$target_dir"
elif command -v unzip >/dev/null; then
unzip "$filename" -d "$target_dir"
else
if command -v powershell.exe >/dev/null; then
powershell.exe -Command "Expand-Archive -Path \"$filename\" -DestinationPath \"$target_dir\""
else
echo "Error: Neither 'bsdtar', 'unzip', nor 'powershell' commands found."
exit 1
fi
fi
rm "$filename"
echo "Extraction complete. Contents extracted to: $target_dir"