Created
March 20, 2026 05:22
-
-
Save mcandre/dcb348104db8b24ba9f43898c7e668e0 to your computer and use it in GitHub Desktop.
dest scratchpad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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