From 922879016e690e208ceb7c9422e6a647e9fc2beb Mon Sep 17 00:00:00 2001 From: Flo Date: Sat, 21 Dec 2024 03:52:33 +0100 Subject: [PATCH] __devenv --- bin/drun | 6 ++++-- script/update_profile | 4 ---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/drun b/bin/drun index 8a3c159..badd289 100644 --- a/bin/drun +++ b/bin/drun @@ -1,8 +1,10 @@ #!/bin/bash +ENV_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd ) +source $ENV_DIR/bin/denv_msg drun() { if [ $# -lt 2 ]; then - echo "Verwendung: drun " + denv_error_msg "Verwendung: drun [system] " return 1 fi @@ -12,7 +14,7 @@ drun() { local CONTAINER_ID=$(docker ps -qf "name=$CONTAINER_NAME-app") if [ -z "$CONTAINER_ID" ]; then - echo "Container '$CONTAINER_NAME' wurde nicht gefunden." + denv_error_msg "Container '$CONTAINER_NAME' wurde nicht gefunden." return 1 fi diff --git a/script/update_profile b/script/update_profile index 3bf3eb8..24225c4 100755 --- a/script/update_profile +++ b/script/update_profile @@ -18,8 +18,6 @@ fi TEMPLATE_CONTENT=$(<"$TEMPLATE_FILE") -denv_info_msg "[dev-env]: Update $PROFILE_FILE" - # Check if start marker already exists in profile file if grep -q "$START_MARKER" "$PROFILE_FILE"; then denv_echo_msg "[dev-env]: Section already exists. Update contents..." @@ -33,5 +31,3 @@ fi ENV_DIR_STRING="#DEV-ENV\nDEV_ENV_PATH=$ENV_DIR\n#DEV-ENV" # Add contents echo -e "\n$START_MARKER\n$ENV_DIR_STRING\n$TEMPLATE_CONTENT\n$END_MARKER" >> "$PROFILE_FILE" - -denv_success_msg "[dev-env]: Successfully updated $PROFILE_FILE"