fix(updater): 忽略容器路径并优先使用 Compose 配置目录

This commit is contained in:
2026-09-28 12:01:39 +08:00
parent 63538ec5b7
commit 49d4af27ca
4 changed files with 40 additions and 3 deletions
+17
View File
@@ -85,3 +85,20 @@ func TestResolveComposePlanUsesHostProjectDir(t *testing.T) {
t.Fatalf("helper compose 路径不正确: %s", plan.helperComposePath)
}
}
func TestIsContainerPath(t *testing.T) {
cases := []struct {
path string
want bool
}{
{"/workspace", true},
{"/workspace/docker-compose.yml", true},
{"/vol1/1000/Docker/mafrp", false},
{"/vol1/1000/Docker/mafrp/docker-compose.yml", false},
}
for _, tc := range cases {
if got := isContainerPath(tc.path, "/workspace"); got != tc.want {
t.Fatalf("isContainerPath(%q) = %v, want %v", tc.path, got, tc.want)
}
}
}