Skip to content

Commit 6483fb8

Browse files
authored
Introduce apt_install_wrapper function to run apt commands depending on the terminal (#90)
1 parent a613848 commit 6483fb8

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

lib/armbian-configng/config.ng.system.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
#!/bin/bash
22

33

4+
module_options+=(
5+
["apt_install_wrapper,author"]="igorpecovnik"
6+
["apt_install_wrapper,ref_link"]=""
7+
["apt_install_wrapper,feature"]="Install wrapper"
8+
["apt_install_wrapper,desc"]="Install wrapper"
9+
["apt_install_wrapper,example"]="apt_install_wrapper apt-get -y purge armbian-zsh"
10+
["apt_install_wrapper,status"]="Active"
11+
)
12+
#
13+
# @description Use TUI / GUI for apt install if exists
14+
#
15+
function apt_install_wrapper
16+
{
17+
if [ -t 0 ] ; then
18+
debconf-apt-progress -- $@
19+
else
20+
# Terminal not defined - proceed without TUI
21+
$@
22+
fi
23+
24+
425
module_options+=(
526
["install_de,author"]="Igor Pecovnik"
627
["install_de,ref_link"]=""

0 commit comments

Comments
 (0)