From eb64cd702ad108345bc62192e4d383175b6aacb7 Mon Sep 17 00:00:00 2001 From: toxa Date: Wed, 22 Nov 2023 15:54:46 +0300 Subject: [PATCH] + true script dir option for fetching related bash-scripts config on some quick commands --- bash/enter-to-workspace.sh | 4 ++-- bash/mariadb.sh | 4 ++-- bash/mysql.sh | 4 ++-- bash/restart-nginx.sh | 4 ++-- bash/root-onto-workspace.sh | 4 ++-- bash/tail-db-general-log.sh | 1 + bash/update-composer.sh | 4 ++-- bash/xdebug-quit.sh | 1 + bash/xdebug-start.sh | 1 + 9 files changed, 15 insertions(+), 12 deletions(-) diff --git a/bash/enter-to-workspace.sh b/bash/enter-to-workspace.sh index 63f1a5e..3ce059e 100755 --- a/bash/enter-to-workspace.sh +++ b/bash/enter-to-workspace.sh @@ -1,7 +1,7 @@ #!/bin/bash -DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" +SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))" -. $DIR/bash/_docker-cmd.sh || { +. $SCRIPT_DIR/_docker-cmd.sh || { echo "no docker cmd is presented" && exit 1 } diff --git a/bash/mariadb.sh b/bash/mariadb.sh index b5852e1..73d4c71 100755 --- a/bash/mariadb.sh +++ b/bash/mariadb.sh @@ -1,7 +1,7 @@ #!/bin/bash -DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" +SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))" -. $DIR/bash/_docker-cmd.sh || { +. $SCRIPT_DIR/_docker-cmd.sh || { echo "no docker cmd is presented" && exit 1 } diff --git a/bash/mysql.sh b/bash/mysql.sh index 9a2a47e..c511420 100755 --- a/bash/mysql.sh +++ b/bash/mysql.sh @@ -1,7 +1,7 @@ #!/bin/bash -DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" +SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))" -. $DIR/bash/_docker-cmd.sh || { +. $SCRIPT_DIR/_docker-cmd.sh || { echo "no docker cmd is presented" && exit 1 } diff --git a/bash/restart-nginx.sh b/bash/restart-nginx.sh index c5fedec..e131cb1 100755 --- a/bash/restart-nginx.sh +++ b/bash/restart-nginx.sh @@ -1,7 +1,7 @@ #!/bin/bash -DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" +SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))" -. $DIR/bash/_docker-cmd.sh || { +. $SCRIPT_DIR/_docker-cmd.sh || { echo "no docker cmd is presented" && exit 1 } diff --git a/bash/root-onto-workspace.sh b/bash/root-onto-workspace.sh index b48cffa..936d1f7 100644 --- a/bash/root-onto-workspace.sh +++ b/bash/root-onto-workspace.sh @@ -1,7 +1,7 @@ #!/bin/bash -DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" +SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))" -. $DIR/bash/_docker-cmd.sh || { +. $SCRIPT_DIR/_docker-cmd.sh || { echo "no docker cmd is presented" && exit 1 } diff --git a/bash/tail-db-general-log.sh b/bash/tail-db-general-log.sh index 66b2fa5..8a1ca54 100755 --- a/bash/tail-db-general-log.sh +++ b/bash/tail-db-general-log.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Not working on windows symlinks DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" GENERAL_LOG_FILE_PATH="${DIR}/log/mariadb/mariadb.log" diff --git a/bash/update-composer.sh b/bash/update-composer.sh index 20a9e5f..69c4319 100755 --- a/bash/update-composer.sh +++ b/bash/update-composer.sh @@ -1,7 +1,7 @@ #!/bin/bash -DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" +SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))" -. $DIR/bash/_docker-cmd.sh || { +. $SCRIPT_DIR/_docker-cmd.sh || { echo "no docker cmd is presented" && exit 1 } diff --git a/bash/xdebug-quit.sh b/bash/xdebug-quit.sh index 9971bab..86b4953 100755 --- a/bash/xdebug-quit.sh +++ b/bash/xdebug-quit.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Not working on windows symlinks DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" PHP_VERSION=$1 # Without dot diff --git a/bash/xdebug-start.sh b/bash/xdebug-start.sh index 2710279..b1fb6f2 100755 --- a/bash/xdebug-start.sh +++ b/bash/xdebug-start.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Not working on windows symlinks DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" PHP_VERSION=$1 # Without dot