Skip to content

Commit

Permalink
Update cmdline.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git authored Nov 1, 2024
1 parent a81f08d commit dff6987
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions cmdline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,8 @@ if test "${A5K_FUNCTIONS_INCLUDED:-false}" = 'false'; then

if test -z "${MAIN_DIR-}"; then
# shellcheck disable=SC3028,SC2128 # Intended: In POSIX sh, BASH_SOURCE is undefined / Expanding an array without an index only gives the first element
if MAIN_DIR="${BASH_SOURCE-}" && test -n "${MAIN_DIR}"; then
:
elif printf '%s\n' "${1}" | grep -q -m 1 -- 'cmdline.sh$' && MAIN_DIR="${1}"; then
:
else MAIN_DIR=''; fi
echo '---'
printf '%s\n' "${1}" || echo $?
echo '---'
printf '%s\n' "${1}" | grep -q -m 1 -- 'cmdline.sh$' || echo $?
echo '---'
dirname "${MAIN_DIR}" || echo $?
echo '---'
if MAIN_DIR="${BASH_SOURCE-}" && test -n "${MAIN_DIR}"; then :; else MAIN_DIR="${1}"; fi
case "${MAIN_DIR}" in *'cmdline.sh') ;; *) MAIN_DIR='' ;; esac

if test -n "${MAIN_DIR}" && MAIN_DIR="$(dirname "${MAIN_DIR}")" && MAIN_DIR="$(realpath "${MAIN_DIR}")"; then
export MAIN_DIR
Expand Down

0 comments on commit dff6987

Please sign in to comment.