logik2021/code/scripts/build.sh

32 lines
832 B
Bash
Raw Normal View History

#!/usr/bin/env bash
################################################################################################
# NOTE: `chmod +x build.sh` vorher ausführen, um dieses Skript benutzen zu können.
################################################################################################
2021-05-06 12:44:29 +02:00
################################
# HILFSMETHODEN
################################
function call_python() {
[ "$OSTYPE" == "msys" ] && py -3 $@ || python3 $@;
}
2021-05-09 18:21:36 +02:00
function check_requirements() {
call_python -m pip install "$( cat scripts/requirements )" >> /dev/null;
}
2021-05-06 12:44:29 +02:00
function run_code() {
call_python main.py;
}
2021-05-06 12:44:29 +02:00
################################
# HAUPTVORGÄNGE
################################
# Kann auskommentiert werden, wenn nötige Module schon installiert:
2021-05-09 18:21:36 +02:00
check_requirements;
# Code ausführen:
2021-05-09 18:21:36 +02:00
run_code;