mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-01 19:47:37 +03:00
17 lines
No EOL
487 B
Bash
Executable file
17 lines
No EOL
487 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Use sed to extract the value of the -o parameter
|
|
output=$(echo "$@" | sed -n 's/.*-o \([^ ]*\).*/\1/p')
|
|
|
|
# Ensure the directory part of the output exists
|
|
mkdir -p "$(dirname "$output")"
|
|
|
|
# Build the source folder name based on GOOS, GOARCH and GOARM.
|
|
source="${GOOS}_${GOARCH}"
|
|
if [ "$GOARCH" = "arm" ]; then
|
|
source="${source}_${GOARM}"
|
|
fi
|
|
|
|
# Copy the output to the desired location
|
|
chmod +x binaries/"${source}"/navidrome*
|
|
cp binaries/"${source}"/navidrome* "$output" |