-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_ressources.sh
49 lines (42 loc) · 1.18 KB
/
get_ressources.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# Download custom fonts and music
# Ressources URLs
# Fonts
INTER_UI_URL="https://github.com/rsms/inter/releases/download/v2.1/Inter-UI-2.1.zip"
# MIDI
MIDI_URL="https://www.dropbox.com/sh/l28n6wzh9l4guvr/AADJipJ9WZv6PWnQXW8N78T9a?dl=1"
# Ressources folders
FONTS_FOLDER=../assets/fonts
MIDI_FOLDER=../assets/midi
# Initialisation
# Look for wget
if [ "$(which wget)" != "" ]; then
download="wget -q --show-progress -O"
elif [ "$(which curl)" != "" ]; then
download="curl -o"
else
echo "wget and curl not found in PATH. Please install one of them."
exit 1
fi
# Create folders in case they don't exist
mkdir -p $FONTS_FOLDER $MIDI_FOLDER
( # Subshell to ease use of `cd`
# Download & extract fonts, and remove temp files
if [ ! -e $FONTS_FOLDER/Inter-UI-Regular.ttf ]; then
cd $FONTS_FOLDER
echo "Downloading fonts..."
$download inter.zip $INTER_UI_URL
unzip inter.zip "Inter UI (TTF)/Inter-UI-Regular.ttf"
mv "Inter UI (TTF)"/* .
rm -r "Inter UI (TTF)/" inter.zip
fi
)
(
if [[ "$(ls $MIDI_FOLDER)" == "" ]]; then
cd $MIDI_FOLDER
echo "Downloading MIDI files..."
$download midi.zip $MIDI_URL
unzip midi.zip
rm -r midi.zip
fi
)