Skip to content

Commit

Permalink
Modify installed_apps, enabled_apps and disabled_apps to be eas…
Browse files Browse the repository at this point in the history
…ier to change later
  • Loading branch information
CLHatch committed Feb 2, 2025
1 parent c96c158 commit 2c9a6c7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .scripts/disabled_apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ set -Eeuo pipefail
IFS=$'\n\t'

disabled_apps() {
grep --color=never -o -P '^[A-Z][A-Z0-9]*(__[A-Z0-9]+)?(?=__ENABLED='"'"'?false'"'"'?)' "${COMPOSE_ENV}" | sort || true
local APPNAME_REGEX='^[A-Z][A-Z0-9]*(__[A-Z0-9]+)?'
local FALSE_REGEX="('?false'?)"
local DISABLED_REGEX="__ENABLED\s*=${FALSE_REGEX}"
local DISABLED_APPS_REGEX="${APPNAME_REGEX}(?=${DISABLED_REGEX})"

#notice "DISABLED_APPS_REGEX [ ${DISABLED_APPS_REGEX} ]"
grep --color=never -o -P "${DISABLED_APPS_REGEX}" "${COMPOSE_ENV}" | sort || true
}

test_disabled_apps() {
Expand Down
9 changes: 7 additions & 2 deletions .scripts/enabled_apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ set -Eeuo pipefail
IFS=$'\n\t'

enabled_apps() {
#grep --color=never -o -P '^\s*\K([A-Z][A-Z0-9]*(__[A-Z0-9]+)?)(?=_ENABLED='"'"'?true'"'"'?$)' "${COMPOSE_ENV}"
grep --color=never -o -P '^[A-Z][A-Z0-9]*(__[A-Z0-9]+)?(?=__ENABLED='"'"'?true'"'"'?)' "${COMPOSE_ENV}" | sort || true
local APPNAME_REGEX='^[A-Z][A-Z0-9]*(__[A-Z0-9]+)?'
local TRUE_REGEX="('?true'?)"
local ENABLED_REGEX="__ENABLED\s*=${TRUE_REGEX}"
local ENABLED_APPS_REGEX="${APPNAME_REGEX}(?=${ENABLED_REGEX})"

#notice "ENABLED_APPS_REGEX [ ${ENABLED_APPS_REGEX} ]"
grep --color=never -o -P "${ENABLED_APPS_REGEX}" "${COMPOSE_ENV}" | sort || true
}

test_enabled_apps() {
Expand Down
6 changes: 5 additions & 1 deletion .scripts/installed_apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ set -Eeuo pipefail
IFS=$'\n\t'

installed_apps() {
grep --color=never -o -P '^[A-Z][A-Z0-9]*(__[A-Z0-9]+)?(?=__ENABLED\s*=)' "${COMPOSE_ENV}" | sort || true
local APPNAME_REGEX='^[A-Z][A-Z0-9]*(__[A-Z0-9]+)?'
local INSTALLED_APPS_REGEX="${APPNAME_REGEX}(?=__ENABLED\s*=)"

#notice "INSTALLED_APPS_REGEX [ ${INSTALLED_APPS_REGEX} ]"
grep --color=never -o -P "${INSTALLED_APPS_REGEX}" "${COMPOSE_ENV}" | sort || true
}

test_installed_apps() {
Expand Down

0 comments on commit 2c9a6c7

Please sign in to comment.