-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackageRelease.command
More file actions
executable file
·47 lines (37 loc) · 1.21 KB
/
Copy pathPackageRelease.command
File metadata and controls
executable file
·47 lines (37 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/zsh
set -e
cd "$(dirname "$0")"
archive_name="MacroMac-macos-universal.zip"
binary_path=".build/apple/Products/Release/macro"
if ! swift build -c release --arch arm64 --arch x86_64; then
swift build -c release
archive_name="MacroMac-macos-$(uname -m).zip"
binary_path=".build/release/macro"
fi
rm -rf dist/MacroMac dist/MacroMac-macos-*.zip
mkdir -p dist/MacroMac/macros
cp "$binary_path" dist/MacroMac/macro
cp LICENSE dist/MacroMac/LICENSE
cp README.md dist/MacroMac/README.md
cp macros/example.json dist/MacroMac/macros/example.json
cp macro.config.example.json dist/MacroMac/macro.config.example.json
cat > dist/MacroMac/Macro.command <<'EOF'
#!/bin/zsh
cd "$(dirname "$0")"
exec ./macro
EOF
cat > dist/MacroMac/Example.command <<'EOF'
#!/bin/zsh
cd "$(dirname "$0")"
exec ./macro --runner --play --macro example.json
EOF
cat > dist/MacroMac/Hotkeys.command <<'EOF'
#!/bin/zsh
cd "$(dirname "$0")"
exec ./macro --hotkeys
EOF
chmod +x dist/MacroMac/macro dist/MacroMac/Macro.command dist/MacroMac/Example.command dist/MacroMac/Hotkeys.command
printf '%s\n' "$archive_name" > dist/archive-name.txt
(cd dist && zip -qry "$archive_name" MacroMac)
echo "Packaged: dist/MacroMac"
echo "Archive: dist/$archive_name"