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.
16 lines
449 B
Text
16 lines
449 B
Text
OPENCODE_CONTAINER_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
|
|
opencode() {
|
|
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 /home/"$user"/.opencode/bin/opencode "$@" \
|
|
2> >(grep -v "No services to build" >&2)
|
|
}
|