Skip to content

Instantly share code, notes, and snippets.

@mcandre
Created March 20, 2026 05:22
Show Gist options
  • Select an option

  • Save mcandre/dcb348104db8b24ba9f43898c7e668e0 to your computer and use it in GitHub Desktop.

Select an option

Save mcandre/dcb348104db8b24ba9f43898c7e668e0 to your computer and use it in GitHub Desktop.
dest scratchpad
#!/bin/bash
unset IFS
set -eu
if [ -z "${DEST:-}" ]; then
exit
fi
mkdir -p "$DEST"
lookup_apps() {
cargo metadata \
--format-version 1 \
--no-deps |
jq -r '.packages[0].targets.[] | select(.kind | index("bin") != null).name'
}
apps_output="$(lookup_apps)"
apps=()
while IFS=$'\n' read -r line; do
apps+=("$line")
done <<<"$apps_output"
for app in "${apps[@]}"; do
cp "target/release/$app" "$DEST"
done
//go:build mage
package main
// Build compiles Go projects.
func Install() error {
if err := mx.Install(); err != nil {
return err
}
dest := ArtifactsPath
if d, ok := os.LookupEnv("DEST"); ok && d != "" {
dest = d
}
if err := os.MkdirAll(dest, 0755); err != nil {
return err
}
//
// TODO: Obtain list of executables
// TODO: Copy each executable from GOBIN to DEST
//
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment