logik2021/code/run.sh

32 lines
829 B
Bash
Raw Normal View History

#!/usr/bin/env bash
################################################################################################
2021-05-06 12:44:29 +02:00
# NOTE: `chmod +x run.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-06 12:44:29 +02:00
function run_check_requirements() {
call_python -m pip install "$( cat 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:
run_check_requirements;
# Code ausführen:
2021-05-06 12:44:29 +02:00
run_code