fix: Fixes webapp script logging errors.

This commit is contained in:
2025-11-09 13:57:02 -05:00
parent 6b13291fff
commit 307a971371

21
webapp
View File

@@ -3,6 +3,16 @@
# Installs or uninstalls webapps based on the spec in the './webapps' directory.
#
# This is used when setting up a new machine.
#
set -e
set -o nounset
set -o pipefail
THIS_FILE=${BASH_SOURCE[0]}
LOG_LABEL=$(basename $THIS_FILE)
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
if [ -z "$DEV_ENV" ]; then
echo "env var DEV_ENV needs to be present"
@@ -36,11 +46,7 @@ while [[ $# -gt 0 ]]; do
done
log() {
if [[ $dry_run == "1" ]]; then
echo "[DRY_RUN]: $1"
else
echo "$1"
fi
logging log --source "$THIS_FILE" "$@"
}
install() {
@@ -85,6 +91,11 @@ uninstall() {
############################## MAIN ##############################
# Setup logging file and label.
source "$SCRIPTS/hypr/logging"
setup-logging "$LOG_FILE" "$LOG_LABEL"
export LOG_ENABLE_DRY_RUN="$dry_run"
log "WEBAPP: -- grep: $grep"
apps_dir=$(find $DEV_ENV/env/webapps -mindepth 1 -maxdepth 1 -type f)