Skip to content

Commit

Permalink
Add jq whiptail and to default package dependencies (#45)
Browse files Browse the repository at this point in the history
* Add jq whiptail and to default dependencies

* Update config.ng.functions.sh

Added jq check with installation prompt, enhanced whiptail prompt with install instructions, and removed leftover line after moving checks to runtime

* Update config.ng.functions.sh

Refactored dependency checks to use an array for missing multiple dependencies, added combined installation prompt

---------

Co-authored-by: Joey Turner <[email protected]>
  • Loading branch information
igorpecovnik and Tearran authored Aug 30, 2024
1 parent ffafd60 commit ffe6930
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
homepage: "https://www.armbian.com"
section: "default"
priority: "optional"
depends: "bash"
depends: "bash jq whiptail"
description: "Configng"

secrets:
Expand Down
22 changes: 18 additions & 4 deletions lib/armbian-configng/config.ng.functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,24 @@ module_options+=(
#
function set_runtime_variables(){

[[ -z "$DIALOG" ]] && echo "Please install whiptail" && exit 1 ;

missing_dependencies=()

# Check if whiptail is available and set DIALOG
if [[ -z "$DIALOG" ]]; then
missing_dependencies+=("whiptail")
fi

# Check if jq is available
if ! [[ -x "$(command -v jq)" ]]; then
missing_dependencies+=("jq")
fi

# If any dependencies are missing, print a combined message and exit
if [[ ${#missing_dependencies[@]} -ne 0 ]]; then
echo "Error: Please install the following dependencies using 'sudo apt install ${missing_dependencies[*]}'"
exit 1
fi

DIALOG_CANCEL=1
DIALOG_ESC=255

Expand Down Expand Up @@ -283,8 +299,6 @@ module_options+=(
#
# Function to set the tui colors
#
[[ -x "$(command -v whiptail)" ]] && DIALOG="whiptail" || exit 1 ;

function set_colors() {
local color_code=$1

Expand Down

0 comments on commit ffe6930

Please sign in to comment.