mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
fix: Fixes webapp script logging errors.
This commit is contained in:
21
webapp
21
webapp
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user