From f77b1ce33135f7b0b7402f19a62f2fd74ea83d2b Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Sat, 2 Apr 2022 16:39:21 +0200 Subject: [PATCH] Fixing snapcraft --- .../launcher/launch-logarithmplotter | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/linux/snapcraft/launcher/launch-logarithmplotter b/linux/snapcraft/launcher/launch-logarithmplotter index d23e4ce..7f8b61e 100755 --- a/linux/snapcraft/launcher/launch-logarithmplotter +++ b/linux/snapcraft/launcher/launch-logarithmplotter @@ -8,15 +8,24 @@ set \ -o pipefail # GTK theme integration (we have Qt fetch the GTK theme mirroring the host Qt theme...) +# Currently broken with portals #export QT_QPA_PLATFORMTHEME=kde # Check if the last parameter is a file, and if so, add the argument "--no-checks-for-updates" BEFORE it. -last="${@:$#}" # last parameter -length=$(($#-1)) -args=("${@:1:$length}") # all parameters except the last -if [ -f "$last" ]; then - ${args} --no-check-for-updates "$last" +length=$(($#-1)) + +echo "Len: $length" + +if [ $length -gt 0 ]; then + last="${@:$#}" # last parameter + args=("${@:1:$length}") # all parameters except the last + + if [ -f "$last" ]; then + ${args} --no-check-for-updates "$last" + else + ${@} --no-check-for-updates + fi else ${@} --no-check-for-updates fi