File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed
Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 11# speedwagon
22
3- A very simple CLI tool for downloading Apple's Xcode simulator runtimes without needing a copy of Xcode on a Mac.
3+ A very simple CLI tool for downloading Apple's Xcode simulator runtimes without needing a copy of Xcode, or a Mac.
44
55## Why?
66
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -eux
4+
5+ NAME=speedwagon
6+
7+ PLATFORMS=(
8+ darwin
9+ linux
10+ windows
11+ )
12+
13+ for platform in " ${PLATFORMS[@]} " ; do
14+ exe_name=" ${NAME} _${platform} "
15+
16+ # Windows should have an .exe at the end
17+ if [[ " ${platform} " = " windows" ]]; then
18+ exe_name=" ${exe_name} .exe"
19+ fi
20+
21+ # macOS should be a universal binary
22+ if [[ " ${platform} " = " darwin" ]]; then
23+ for goarch in arm64 amd64; do
24+ GOARCH=" ${goarch} " go build -o " ${NAME} _${goarch} "
25+ done
26+ lipo -create -output " ${exe_name} " " ${NAME} _arm64" " ${NAME} _amd64"
27+ rm -f " ${NAME} _arm64" " ${NAME} _amd64"
28+ else
29+ GOOS=" ${platform} " go build -o " ${exe_name} "
30+ fi
31+ done
32+
You can’t perform that action at this time.
0 commit comments