Go-Programm lc-agent: sendet neu kopierten Text als Clip ins Projekt "Zwischenablage" und übernimmt eigene Clips anderer Geräte live in die Zwischenablage. Von Passwort-Managern markierte Inhalte werden nie gesendet; Größengrenze, Ausschlussmuster, nur die letzten 50 eigenen Clips. Wiederholt beim Start, bis der Server erreichbar ist; beendet sich bei widerrufenem Token mit Exit-Code 3. Build für alle Plattformen per build.sh im Container, Autostart-Vorlagen für alle drei Systeme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
1.2 KiB
Bash
Executable File
27 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
# Checks and builds lc-agent for all platforms in a throwaway Go container.
|
|
# Output: dist/. Usage: ./build.sh (needs only Docker on the host)
|
|
set -eu
|
|
cd "$(dirname "$0")"
|
|
VERSION="$(git describe --tags --always --dirty 2>/dev/null || echo dev)"
|
|
|
|
docker run --rm -v "$PWD":/src -w /src \
|
|
-e GOMODCACHE=/src/.cache/mod -e GOCACHE=/src/.cache/build \
|
|
-e GOFLAGS=-buildvcs=false -e CGO_ENABLED=0 -e VERSION="$VERSION" \
|
|
golang:1.26-alpine sh -euc '
|
|
test -z "$(gofmt -l .)" || { gofmt -l .; echo "gofmt: Dateien nicht formatiert"; exit 1; }
|
|
for os in linux windows darwin; do GOOS=$os go vet ./...; done
|
|
go test ./...
|
|
rm -rf dist && mkdir dist
|
|
build() { GOOS=$1 GOARCH=$2 go build -trimpath -ldflags "-s -w -X main.version=$VERSION ${4:-}" -o "dist/$3" ./cmd/lc-agent; }
|
|
build linux amd64 lc-agent-linux-amd64
|
|
build linux arm64 lc-agent-linux-arm64
|
|
build darwin amd64 lc-agent-macos-intel
|
|
build darwin arm64 lc-agent-macos-apple
|
|
build windows amd64 lc-agent.exe
|
|
# No console window; for autostart (log with -log)
|
|
build windows amd64 lc-agentw.exe "-H=windowsgui"
|
|
cd dist && sha256sum * > SHA256SUMS
|
|
'
|
|
ls -l dist
|