-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathbuild-client-release.sh
More file actions
executable file
·47 lines (42 loc) · 1.93 KB
/
Copy pathbuild-client-release.sh
File metadata and controls
executable file
·47 lines (42 loc) · 1.93 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/bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
VERSION="$(/usr/bin/tr -d '[:space:]' < "$ROOT/VERSION")"
OUTPUT="${1:-$HOME/Desktop/Codex 主题编辑器.zip}"
TMP="$(/usr/bin/mktemp -d /tmp/codex-dream-client.XXXXXX)"
CLIENT_ROOT="$TMP/Codex 主题编辑器"
ENGINE="$CLIENT_ROOT/.codex-dream-skin-studio"
trap '/bin/rm -rf "$TMP"' EXIT
"$ROOT/tests/run-tests.sh"
/bin/mkdir -p "$ENGINE"
/usr/bin/rsync -a \
--exclude '.git/' \
--exclude '.DS_Store' \
--exclude 'release/' \
--exclude 'runtime/' \
"$ROOT/" "$ENGINE/"
/usr/bin/printf '%s\n' \
'#!/bin/bash' \
'set -euo pipefail' \
'ROOT="$(cd "$(dirname "$0")" && pwd -P)"' \
'exec "$ROOT/.codex-dream-skin-studio/scripts/install-dream-skin-macos.sh"' \
> "$CLIENT_ROOT/安装 Codex 主题编辑器.command"
/usr/bin/printf '%s\n' \
"Codex 主题编辑器 $VERSION" \
'' \
'推荐方式:把这个完整 ZIP、你喜欢的图片和“给 Codex 的部署提示词.md”一起发给自己的 Codex。' \
'' \
'手动方式:双击“安装 Codex 主题编辑器.command”。安装完成后,桌面会出现启动、定制、验证和恢复四个入口。' \
'' \
'不要只复制图片或 CSS。隐藏目录 .codex-dream-skin-studio 是完整运行引擎,请勿删除。' \
> "$CLIENT_ROOT/使用说明.txt"
/bin/cp "$ROOT/CLIENT_DEPLOY_PROMPT.md" "$CLIENT_ROOT/给 Codex 的部署提示词.md"
/bin/chmod 755 "$CLIENT_ROOT/安装 Codex 主题编辑器.command"
/bin/chmod 755 "$ENGINE"/*.command "$ENGINE"/scripts/*.sh "$ENGINE"/tests/*.sh
/usr/bin/xattr -cr "$CLIENT_ROOT"
/usr/bin/find "$CLIENT_ROOT" -type f \( -name '.DS_Store' -o -name '._*' \) -delete
/bin/mkdir -p "$(dirname "$OUTPUT")"
/bin/rm -f "$OUTPUT"
COPYFILE_DISABLE=1 /usr/bin/ditto -c -k --keepParent --norsrc --noextattr "$CLIENT_ROOT" "$OUTPUT"
SHA256="$(/usr/bin/shasum -a 256 "$OUTPUT" | /usr/bin/awk '{print $1}')"
/usr/bin/printf 'Created %s\nSHA-256 %s\n' "$OUTPUT" "$SHA256"