]> git.tue.mpg.de Git - gsu.git/commitdiff
gsu_gui: Add check for dialog executable.
authorAndre Noll <maan@systemlinux.org>
Fri, 13 Dec 2013 09:57:42 +0000 (10:57 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 29 Aug 2014 19:39:58 +0000 (21:39 +0200)
Currently, programs which use gsu_gui exit silently with no indication about
what went wrong if dialog is not installed. This patch makes it print an error
message in this case.

misc/gsu/gui

index 30c95a43d662e17067cc058f1ce0eb14b3f14fe7..5b108e1ad4521d74ec5a8b6a16c061484c8a0cef 100644 (file)
@@ -201,6 +201,11 @@ gsu_gui()
        local tree="$1" subtree
 
        _gsu_setup
+       type -t dialog &> /dev/null
+       if (($? != 0)); then
+               gsu_msg "dialog executable not found"
+               exit 1
+       fi
        _get_root_nodes "$tree"
        subtree="$result"
        _browse "$gsu_name main menu" "$tree" "$subtree"