fix(fish): 改用 SourceError 处理 shell 查询失败

This commit is contained in:
2026-04-09 15:51:45 +08:00
parent 33f4beb72a
commit af42eb913f
+1 -2
View File
@@ -37,8 +37,7 @@ class FishModule(Module):
check=False,
)
if result.returncode != 0:
decman.error(f"无法读取用户 {self.user} 的 passwd 信息")
return
raise decman.SourceError(f"无法读取用户 {self.user} 的 passwd 信息")
# passwd 格式: name:x:uid:gid:gecos:home:shell
shell = result.stdout.strip().split(":")[-1]
if shell != "/usr/bin/fish":