e-bike-tracker-device/scripts/build.sh
2022-06-10 01:28:39 +02:00

24 lines
No EOL
565 B
Bash
Executable file

#!/bin/bash
# Gitpod and VsCode Codespaces tasks do not source the user environment
if [ "${USER}" == "gitpod" ]; then
which idf.py >/dev/null || {
source ~/export-esp.sh > /dev/null 2>&1
}
elif [ "${CODESPACE_NAME}" != "" ]; then
which idf.py >/dev/null || {
source ~/export-esp.sh > /dev/null 2>&1
}
fi
case "$1" in
""|"release")
cargo build --release
;;
"debug")
cargo build
;;
*)
echo "Wrong argument. Only \"debug\"/\"release\" arguments are supported"
exit 1;;
esac