Skip to content

Commit

Permalink
only use XAUTHORITY if it is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
tomeichlersmith committed Aug 28, 2024
1 parent dbaa3e5 commit 44de3d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions denv
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ _denv_run() {
# we will be running now and not writing the config
# so we can update the denv_mounts list
[ -d /tmp/.X11-unix ] && denv_mounts="${denv_mounts} /tmp/.X11-unix"
[ -f "${XAUTHORITY}" ] && denv_mounts="${denv_mounts} ${XAUTHORITY}"
if [ -n "${XAUTHORITY+x}" ] && [ -f "${XAUTHORITY}" ]; then
denv_mounts="${denv_mounts} ${XAUTHORITY}"
fi
denv_mounts="${denv_mounts} ${denv_entrypoint}"
case "${denv_runner}" in
docker|podman)
Expand Down Expand Up @@ -427,7 +429,7 @@ _denv_deduce_environment() {
# specify localhost as an allowed source
_display="host.docker.internal:0"
fi
denv_environment="${denv_environment} XAUTHORITY=${XAUTHORITY}"
[ -n "${XAUTHORITY+x}" ] && denv_environment="${denv_environment} XAUTHORITY=${XAUTHORITY}"
denv_environment="${denv_environment} DISPLAY=${_display}"
denv_environment="${denv_environment} DENV_NAME=${denv_name}"
denv_environment="${denv_environment} DENV_RUNNER=${denv_runner}"
Expand Down

0 comments on commit 44de3d0

Please sign in to comment.