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.
This commit is contained in:
parent
39edc252f0
commit
f479a613a0
1 changed files with 8 additions and 5 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue