diff --git a/gha-generate-shell-env.bash b/gha-generate-shell-env.bash index c2ac2f8d25..a237fd8540 100755 --- a/gha-generate-shell-env.bash +++ b/gha-generate-shell-env.bash @@ -2,6 +2,7 @@ set -Euo pipefail _PRESHELL_PATH="${_PRESHELL_PATH:-}" +_SYSTEM_PATH="${PATH:-}" PATH="$PATH:/usr/bin" gha_fsvr_dir="$(dirname "${BASH_SOURCE}")" @@ -23,7 +24,13 @@ else _PYTHONUSERBASE="$(readlink -f bin/pystuff)" fi -pysite="$(PYTHONUSERBASE="$_PYTHONUSERBASE" python3 -msite --user-site)" +python3="$(PATH="$PATH:$_PRESHELL_PATH" which python3)" +$python3 --version >/dev/null || { echo "!python3" 2>&1 ; exit 26 ; } + +jqexe="$(PATH="$_SYSTEM_PATH:$_PRESHELL_PATH" which jq)" +$jqexe --version >/dev/null || { which jq ; echo "!jq" 2>&1 ; exit 27 ; } + +pysite="$(PYTHONUSERBASE="$_PYTHONUSERBASE" ${python3} -msite --user-site)" ###################################################################### echo "$(cat<&2; return \$ function ht-ln() {( source "$ghash/gha.ht-ln.bash" && ht-ln "\$@" )} function hostname(){ echo '$_hostname' ; } -function tee() { TEE="`which tee`" "`which python3`" "$gha_fsvr_dir/util/tee.py" "\$@" ; } +function tee() { TEE="`which tee`" "${python3}" "$gha_fsvr_dir/util/tee.py" "\$@" ; } function colout() { $( - if which colout 2>/dev/null > /dev/null ; then + if PATH="$_SYSTEM_PATH" which colout 2>/dev/null > /dev/null ; then echo \"`which colout`\" else - echo \"`which python3`\" \"$pysite/colout/colout.py\" + echo \"${python3}\" \"$pysite/colout/colout.py\" fi ) "\$@" ; } function parallel() { PARALLEL_SHELL="$BASH" PARALLEL_HOME="$PWD/bin/parallel-home" "`which perl`" "$PWD/bin/parallel" "\$@" ; } -function jq() { "`which jq`" $( +function jq() { "${jqexe}" $( # grr... detect if jq supports -b (binary) # otherwise... fall back to tr -d '\r' workaround # TODO: jq.exe also croaks if jq 'filter\r' contains LFs... - jq -ben 1 2>/dev/null > /dev/null + ${jqexe} -ben 1 2>/dev/null > /dev/null if [[ $? == 0 ]] ; then echo '-b "$@"' else diff --git a/util/load_with_settings_and_cache_here.bat b/util/load_with_settings_and_cache_here.bat index 59a9f72bbd..2cfc27a75e 100644 --- a/util/load_with_settings_and_cache_here.bat +++ b/util/load_with_settings_and_cache_here.bat @@ -1,18 +1,13 @@ -REM launch firestorm with os-level settings and cache locations -REM --humbletim 2024.03.08 -REM %~dp0 == path of this batch file -REM %* forwards any arguments alonge; eg: -REM launch_with_settings_and_cache_here.bat --set UIScaleFactor 1 - -REM new Firestorm_x64 user settings location +@echo off +REM | launch viewer with in-folder APPDATA (user settings) LOCALAPPDATA (cache, logs, etc.) +REM | ... for FS this will emerge ./Firestorm_x64 and ./FirestormOS_x64 respectively +REM | --humbletim 2024.03.08 +REM | +REM | %* forwards any arguments alonge; eg: +REM | launch_with_settings_and_cache_here.bat --set UIScaleFactor 1 +REM | %~dp0 == path of this batch file set "APPDATA=%~dp0" - -REM new FirestormOS_x64 cache/temp location - set "LOCALAPPDATA=%~dp0" - -REM actual .exe name to launch -REM use an absolute path unless in same folder as this batch file - -call $APPLICATION_EXE %* +echo APPDATA=%APPDATA% LOCALAPPDATA=%LOCALAPPDATA% +call %~dp0\$APPLICATION_EXE %*