-
-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add command to list apps in a table format, including if they are ins…
…talled, enabled, or disabled
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
IFS=$'\n\t' | ||
|
||
apps_list() { | ||
local -a APPS | ||
local APPS=($(run_script 'builtin_apps')) | ||
for index in "${!APPS[@]}"; do | ||
local APPNAME=${APPS[$index]} | ||
APPS[$index]+=',' | ||
if run_script 'app_is_installed' ${APPNAME}; then | ||
APPS[$index]+='*INSTALLED*,' | ||
if run_script 'app_is_enabled' ${APPNAME}; then | ||
APPS[$index]+='*ENABLED*' | ||
else | ||
APPS[$index]+='*DISABLED*' | ||
fi | ||
else | ||
APPS[$index]+=',' | ||
fi | ||
APPS[$index]+=',' | ||
#if run_script 'app_is_depreciated' ${APPNAME}; then | ||
# APPS[$index]+='(DEPRECIATED)' | ||
#fi | ||
done | ||
printf '%s\n' "${APPS[@]}" | column -t -s ',' | ||
} | ||
|
||
test_apps_list() { | ||
run_script 'apps_list' | ||
# warn "CI does not test apps_list." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters