From f479a613a0ac297ad6dc80da3a597dc6705b0ed7 Mon Sep 17 00:00:00 2001 From: Jeena Date: Wed, 14 Jan 2026 10:50:42 +0900 Subject: [PATCH] Fix problem with arguments It was impossible to have several arguments while calling opencode in the container like `opencode auth list`, it would just break. With this change this also works. --- opencode.aliases | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/opencode.aliases b/opencode.aliases index 008d113..ccd8384 100644 --- a/opencode.aliases +++ b/opencode.aliases @@ -1,13 +1,16 @@ OPENCODE_CONTAINER_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)" opencode() { - UID=$(id -u) \ - GID=$(id -g) \ - USER=$(whoami) \ + local uid=$(id -u) + local gid=$(id -g) + local user=$(whoami) + UID="$uid" \ + GID="$gid" \ + USER="$user" \ docker compose \ -f "$OPENCODE_CONTAINER_DIR/docker-compose.yaml" \ run --rm \ - -u "$UID:$GID" \ - opencode bash -c "/home/$USER/.opencode/bin/opencode \"$@\"" \ + -u "$uid:$gid" \ + opencode /home/"$user"/.opencode/bin/opencode "$@" \ 2> >(grep -v "No services to build" >&2) }