mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 22:22:40 +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.
|
# Installs or uninstalls webapps based on the spec in the './webapps' directory.
|
||||||
#
|
#
|
||||||
# This is used when setting up a new machine.
|
# 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
|
if [ -z "$DEV_ENV" ]; then
|
||||||
echo "env var DEV_ENV needs to be present"
|
echo "env var DEV_ENV needs to be present"
|
||||||
@@ -36,11 +46,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
if [[ $dry_run == "1" ]]; then
|
logging log --source "$THIS_FILE" "$@"
|
||||||
echo "[DRY_RUN]: $1"
|
|
||||||
else
|
|
||||||
echo "$1"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
@@ -85,6 +91,11 @@ uninstall() {
|
|||||||
|
|
||||||
############################## MAIN ##############################
|
############################## 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"
|
log "WEBAPP: -- grep: $grep"
|
||||||
|
|
||||||
apps_dir=$(find $DEV_ENV/env/webapps -mindepth 1 -maxdepth 1 -type f)
|
apps_dir=$(find $DEV_ENV/env/webapps -mindepth 1 -maxdepth 1 -type f)
|
||||||
|
|||||||
Reference in New Issue
Block a user