From e6a40e622c7ab89ee94335595ad4de245a9e6ecc Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 3 Jul 2023 23:43:21 +0200 Subject: [PATCH] download graphic installer if DISPLAY --- installer.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/installer.sh b/installer.sh index 17a9c04..4821284 100755 --- a/installer.sh +++ b/installer.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# © 2022 Harald Barth +# © 2022,2023 Harald Barth # # This file is part of CommandStation-EX # @@ -29,14 +29,28 @@ ACLI="./bin/arduino-cli" function need () { type -p $1 > /dev/null && return + dpkg -l $1 2>&1 | egrep ^ii >/dev/null && return sudo apt-get install $1 type -p $1 > /dev/null && return echo "Could not install $1, abort" exit 255 } - need git + +if [ x$DISPLAY != x ] ; then + # we have DISPLAY, do the graphic thing + need python3-tk + need python3.8-venv + mkdir -p ~/ex-installer/venv + python3 -m venv ~/ex-installer/venv + cd ~/ex-installer/venv || exit 255 + source ./bin/activate + git clone https://github.com/DCC-EX/EX-Installer + cd EX-Installer || exit 255 + pip3 install -r requirements.txt + exec python3 -m ex_installer +fi if test -d `basename "$DCCEXGITURL"` ; then : assume we are almost there cd `basename "$DCCEXGITURL"` || exit 255