Skip to content

Commit

Permalink
fix: host-shell does not pass all args to host cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin authored Jan 14, 2024
1 parent 5a55923 commit 50ceb81
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions includes.container/usr/bin/host-shell
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash

host_command="${1:-${SHELL:-/bin/sh}}"
sudo_command=""
[ "$(id -ru)" -ne 0 ] && sudo_command="sudo"
host_command=""

XDG_RUNTIME_DIR="/run/host/${XDG_RUNTIME_DIR}"
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/host/$(echo "${DBUS_SESSION_BUS_ADDRESS}" | cut -d '=' -f2-)"

if [ "$(basename "${0}")" != "host-shell" ]; then
host_command="$(basename "${0}")"
else
host_command="${1:-${SHELL:-/bin/sh}}"
shift
fi

host-spawn "${host_command}" "${@:2}"
host-spawn "${host_command}" "$@"
exit $?

0 comments on commit 50ceb81

Please sign in to comment.