Files
d2r-mobile/dm/ios/tools/local_env.sh
T
jhaizhouandhubeiqiao 66c3a2fb70 Fix setup on stock macOS bash, shader step false success, battery gate misreport (#4, #5, #7)
- Brace every $NAME that is directly followed by a non-ASCII character in the shell scripts: bash 3.2 in a UTF-8 locale read the first byte of the following character as part of the variable name and aborted under set -u (#4, #6).
- setup.sh and d2rm_pack.py: the shader translation step is complete only when every entry in the completion marker is ok and every library file exists; the script's exit status is no longer hidden by a pipe (#5).
- devbattery.sh / devlock.sh: a missing local timeout or ideviceinfo is reported as such and stops at once, instead of being reported as an offline device and polled for up to an hour (#7).
- smoke_mac.sh builds its package for iPhone only regardless of the project default.

Reported by @SakuraToErii. The setup.sh part of #4 was also submitted by @hubeiqiao in #6.

Co-authored-by: hubeiqiao <12777592+hubeiqiao@users.noreply.github.com>
2026-10-13 03:17:23 +08:00

16 lines
1.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 本机设备配置(不进仓)。被各脚本 source:按序找 $DM_LOCAL_ENV → dm/ios/local.env → ~/.config/dm-ios/local.env,读第一个存在的
# (后一个位置供同一台机器上的多个工作树共用)。样例与各项含义见 dm/ios/local.env.example。
# local_env_need <变量…>:缺哪项就报哪项并返回非零。
# Local device configuration (not committed to the repo). Sourced by the scripts: looks in order at $DM_LOCAL_ENV → dm/ios/local.env → ~/.config/dm-ios/local.env and reads the first that exists
# (the last location lets multiple worktrees on the same machine share it). For a sample and the meaning of each item see dm/ios/local.env.example.
# local_env_need <variables...>: reports whichever items are missing and returns nonzero.
_le_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
for _le_f in "${DM_LOCAL_ENV:-}" "$_le_dir/local.env" "$HOME/.config/dm-ios/local.env"; do
[ -n "$_le_f" ] && [ -f "$_le_f" ] && { set -a; source "$_le_f"; set +a; DM_LOCAL_ENV_FILE=$_le_f; break; }
done
local_env_need() {
local v miss=
for v in "$@"; do [ -n "${!v:-}" ] || miss="$miss $v"; done
[ -z "$miss" ] || { echo "🔴 缺本机配置:${miss}(把 dm/ios/local.env.example 复制成 dm/ios/local.env 填好;本次读的是:${DM_LOCAL_ENV_FILE:-没找到配置文件})" >&2; return 1; }
}