#!/bin/bash

PYTHON=$(which python3)
if [ "$PYTHON" == '' ]; then
  echo "Cannot find python3 executable - exiting"
  exit
fi

# Handle some arguments before running the application
# Supported arguments:
# -d|--debug: debug with -Wd arguments
DEBUG='-OO'
for ARG in $@; do
  case $ARG in
    -d|--debug)
      DEBUG='-Wd'
      ;;
    -f|--force|-a|--autostart)
      ARGS="$ARGS $ARG"
      ;;
    *)
      echo '-d|--debug: start python3 with -Wd parameters'
      echo '-a|--autostart: check if solydxk-welcome can run'
      echo '-f|--force: start solydxk-welcome in a live environment'
      exit
  esac
done

python3 ${DEBUG} /usr/lib/solydxk/welcome/main.py $ARGS
