#!/bin/bash

# in builds.sr.ht, 'bazel' binary is stored in $HOME.
exec env PATH=$PATH:$HOME \
    bazel aquery \
    --platforms "$1" "$2" 2>/dev/null | \
    awk "/action 'GoLink/{f=1};/Outputs: / &&f{print;exit}" | \
    awk -F'\\[|\\]' '{print $2}'