Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Nov 2, 2024
1 parent 312f840 commit 05b7eed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmdline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ command 1> /dev/null 2>&1 -v 'local' || {
if test "${A5K_FUNCTIONS_INCLUDED:-false}" = 'false'; then
main()
{
local _main_dir _run_strategy _applet _nl
local _main_dir _run_strategy _applet _uname_os _nl

# Execute only if the first initialization has not already been done
if test -z "${MAIN_DIR-}" || test -z "${USER_HOME-}"; then

# Avoid picturesque bugs on Bash under Windows
if test -x '/usr/bin/uname' && test "$(/usr/bin/uname 2> /dev/null -o || :)" = 'Msys'; then PATH="/usr/bin:${PATH:-%empty}"; fi
if test -x '/usr/bin/uname' && _uname_os="$(/usr/bin/uname 2> /dev/null -o)" && test "${_uname_os}" = 'Msys'; then PATH="/usr/bin:${PATH:-%empty}"; fi

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
Expand Down Expand Up @@ -51,10 +51,10 @@ if test "${A5K_FUNCTIONS_INCLUDED:-false}" = 'false'; then
elif _gse_tmp_var="$(ps 2> /dev/null -p "${$}" -o 'comm=')" && test -n "${_gse_tmp_var}" && _gse_tmp_var="$(command 2> /dev/null -v "${_gse_tmp_var}")"; then
# On Linux / macOS
# shellcheck disable=SC2230 # Ignore: 'which' is non-standard
case "${_gse_tmp_var}" in *'/'* | *"\\"*) ;; *) _gse_tmp_var="$(which 2> /dev/null "${_gse_tmp_var}")" || return 3 ;; esac # We may not get the full path with "command -v" on osh
case "${_gse_tmp_var}" in *'/'* | *"\\"*) ;; *) _gse_tmp_var="$(which 2> /dev/null "${_gse_tmp_var}")" || return 3 ;; esac # We may not get the full path with "command -v" on some old versions of Oils
elif _gse_tmp_var="${BASH:-${SHELL-}}" && test -n "${_gse_tmp_var}"; then
if test "${_gse_tmp_var}" = '/bin/sh' && test "$(uname 2> /dev/null || :)" = 'Windows_NT'; then _gse_tmp_var="$(command 2> /dev/null -v 'busybox')" || return 2; fi
if test ! -e "${_gse_tmp_var}" && test -e "${_gse_tmp_var}.exe"; then _gse_tmp_var="${_gse_tmp_var}.exe"; fi # Special fix for broken versions of Bash under Windows
if test ! -x "${_gse_tmp_var}" && test -x "${_gse_tmp_var}.exe"; then _gse_tmp_var="${_gse_tmp_var}.exe"; fi # Special fix for broken versions of Bash under Windows
else
return 1
fi
Expand Down

0 comments on commit 05b7eed

Please sign in to comment.