TeaWeb/web/native-codec/download_compiled_files.sh

35 lines
912 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2020-03-31 00:14:48 +00:00
cd "$(dirname "$0")" || exit 1
if [[ -d generated/ ]]; then
rm -r generated
[[ $? -ne 0 ]] && {
echo "Failed to remove old directory!"
exit 1
}
fi
mkdir generated
[[ $? -ne 0 ]] && {
echo "Failed to create the 'generated' directory!"
exit 1
}
2020-03-31 00:14:48 +00:00
curl --version &> /dev/null; _exit_code=$?
[[ $_exit_code -ne 0 ]] && {
echo "Missing CURL. Please install it"
exit 1
}
2020-03-31 00:14:48 +00:00
curl https://web.teaspeak.de/wasm/TeaWeb-Worker-Codec-Opus.js --output generated/TeaWeb-Worker-Codec-Opus.js; _exit_code=$?
[[ $_exit_code -ne 0 ]] && {
echo "Failed to download opus worker library"
exit 1
}
2020-03-31 00:14:48 +00:00
curl https://web.teaspeak.de/wasm/TeaWeb-Worker-Codec-Opus.wasm --output generated/TeaWeb-Worker-Codec-Opus.wasm; _exit_code=$?
[[ $_exit_code -ne 0 ]] && {
echo "Failed to download opus worker library natives"
exit 1
}
echo "Files downloaded successfully"