diff --git a/.gitignore b/.gitignore index de3779c..a6c2815 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ publish/* # 尚未上機驗證的腳本暫存區(不入 repo,測過再搬進 src/) tmp/ + +# mlucas 的 ELF binary(~99 MB),DUT image 已內含,不入 repo +src/Script_ABC_Blanton/hammer/ diff --git a/publish/publish.sh b/publish/publish.sh index 80406a1..499f468 100644 --- a/publish/publish.sh +++ b/publish/publish.sh @@ -7,6 +7,9 @@ # publish/Script_ABC_Blanton_, taking # from the "; Version : Vx.y.z" header of # 1_Blanton_Script_A.ttl. +# V1.0.1 2026-09-06 Exclude hammer/ (the mlucas binaries) from the bundle, +# so the output no longer depends on whether the developer +# has them in their working tree. # ============================================================================= # # The version is READ FROM Script A rather than passed in, so the folder name @@ -33,7 +36,9 @@ info() { printf '[\033[34mINFO\033[0m] %s\n' "$*"; } ok() { printf '[\033[32m OK \033[0m] %s\n' "$*"; } die() { printf '[\033[31mERR \033[0m] %s\n' "$*" >&2; exit 1; } -usage() { sed -n '2,26p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'; exit 0; } +# Print the header block above, up to (but not including) the first line of +# code, so adding a Version History entry never truncates the usage text. +usage() { sed -n '2,/^set -u/p' "${BASH_SOURCE[0]}" | sed '$d' | sed 's/^# \{0,1\}//'; exit 0; } while [ $# -gt 0 ]; do case "$1" in @@ -86,12 +91,19 @@ fi # Captured console logs are per-run and often carry DUT serials, so they are # never shipped; the empty logs/ directory itself is kept because Script A's # logopen writes into it. +# +# hammer/ is excluded as well: it is ~99 MB of mlucas ELF binaries that the DUT +# image already carries, and it is gitignored. Without this exclude the bundle +# would depend on whether the developer happened to have the binaries sitting in +# src/ - 100 MB from one machine, 200 KB from a fresh clone. mkdir -p -- "${DEST}" || die "cannot create ${DEST}" if command -v rsync >/dev/null 2>&1; then - rsync -a --exclude='*.log' "${SRC_DIR}/" "${DEST}/" || die "rsync failed" + rsync -a --exclude='*.log' --exclude='hammer/' "${SRC_DIR}/" "${DEST}/" \ + || die "rsync failed" else cp -a -- "${SRC_DIR}/." "${DEST}/" || die "cp failed" find "${DEST}" -type f -name '*.log' -delete + rm -rf -- "${DEST}/hammer" fi # Tera Term's logopen target, in case the source tree never had one