修复生产部署门禁根用户夹具
Project CI / Repository checks (pull_request) Successful in 1m2s
Project CI / Frontend tests (pull_request) Successful in 1m55s
Project CI / Native shell tests (pull_request) Successful in 2m25s
Project CI / Backend tests (pull_request) Successful in 4m8s

新增install命令替身,忽略夹具环境无法满足的owner/group。

统一根用户与非根用户测试的目录创建、文件复制和权限设置。
This commit is contained in:
2026-07-23 07:27:20 +00:00
parent 5c4ff0fa72
commit fbe9d5dd99
+26
View File
@@ -2434,6 +2434,31 @@ function prepareFixture(name) {
].join('\n'),
'utf8',
);
writeFileSync(
path.join(fakeBin, 'install'),
[
'#!/usr/bin/env bash',
'set -euo pipefail',
'args=()',
'while [[ "$#" -gt 0 ]]; do',
' case "$1" in',
' -o|--owner|-g|--group)',
' shift 2',
' ;;',
' --owner=*|--group=*)',
' shift',
' ;;',
' *)',
' args+=("$1")',
' shift',
' ;;',
' esac',
'done',
'exec /usr/bin/install "${args[@]}"',
'',
].join('\n'),
'utf8',
);
writeFileSync(
path.join(fakeBin, 'sudo'),
[
@@ -2476,6 +2501,7 @@ function prepareFixture(name) {
chmodExecutable(path.join(fakeBin, 'sleep'));
chmodExecutable(path.join(fakeBin, 'stat'));
chmodExecutable(path.join(fakeBin, 'cp'));
chmodExecutable(path.join(fakeBin, 'install'));
chmodExecutable(path.join(fakeBin, 'sudo'));
return {