Fix entrypoint: Copy custom-built opencode binary to persisted directory

This commit is contained in:
southseact-3d
2026-02-16 18:22:09 +00:00
parent e0abc08bf0
commit d36505f104

View File

@@ -176,6 +176,15 @@ fi
ensure_cli_wrappers() {
local bin_dir="$PERSISTED_OPENCODE_DIR/bin"
mkdir -p "$bin_dir"
# Check if we have a custom-built binary at /usr/local/bin/opencode (not a symlink)
if [ -f "/usr/local/bin/opencode" ] && [ ! -L "/usr/local/bin/opencode" ]; then
# Copy the custom-built binary to the persisted directory
log "Copying custom-built opencode binary to persisted directory"
cp -f "/usr/local/bin/opencode" "$bin_dir/opencode"
chmod +x "$bin_dir/opencode"
fi
# Only create symlink for opencode command itself
if [ ! -L "/usr/local/bin/opencode" ]; then
ln -sf "$bin_dir/opencode" "/usr/local/bin/opencode"