summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkj_sh6042026-05-25 17:28:19 -0400
committerkj_sh6042026-05-25 17:28:19 -0400
commit876cec08d10136d1979e7582a13c0439e3298719 (patch)
tree48c6217a474157393ddf9cde35a766111f3ac857
parentf31bfee9b635a1be2247e6eeb5d96ce748cdc7ce (diff)
refactor: try to detect usershell on runtimeHEADmain
-rwxr-xr-xbuild-jupyterlab.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/build-jupyterlab.sh b/build-jupyterlab.sh
index 66f3423..6aa0def 100755
--- a/build-jupyterlab.sh
+++ b/build-jupyterlab.sh
@@ -168,6 +168,11 @@ cat > "${APPDIR}/AppRun" << 'APPRUN_EOF'
SELF="$(readlink -f "$0")"
HERE="$(dirname "$SELF")"
CONDA="${HERE}/usr/lib/miniforge"
+_user_shell="$(awk -F: -v uid="$(id -u 2>/dev/null || echo '')" '$3==uid{print $7; exit}' /etc/passwd 2>/dev/null)"
+[ -x "$_user_shell" ] || _user_shell="${SHELL:-}"
+[ -x "$_user_shell" ] || _user_shell="/bin/bash"
+[ -x "$_user_shell" ] || _user_shell="/bin/sh"
+export SHELL="$_user_shell"
export PYTHONHOME="${CONDA}"
export PATH="${CONDA}/bin:${PATH}"
export TERMINFO_DIRS="${CONDA}/share/terminfo:/usr/share/terminfo:/lib/terminfo:/etc/terminfo"