#!/bin/bash# Use sed to extract the value of the -o parameteroutput=$(echo "$@" | sed -n 's/.*-o \([^ ]*\).*/\1/p')# Ensure the directory part of the output existsmkdir -p "$(dirname "$output")"# Build the source folder name based on GOOS, GOARCH and GOARM.source="${GOOS}_${GOARCH}"if [ "$GOARCH" = "arm" ]; then# GOARM is bare ("5", "6", "7"); the Docker build output uses a "v" prefix# (e.g. linux_arm_v5), so add it back here to match.source="${source}_v${GOARM}"fi# Copy the output to the desired locationchmod +x binaries/"${source}"/navidrome*cp binaries/"${source}"/navidrome* "$output"