fix(cli/completion): re-apply shell-profile source-line guard (re-#78659) (#80797)

This commit is contained in:
Sarah Fortune
2026-05-11 16:01:00 -07:00
committed by GitHub
parent 1f167178f2
commit 3d5b0cb41b

View File

@@ -69,9 +69,9 @@ function formatCompletionSourceLine(
cachePath: string,
): string {
if (shell === "fish") {
return `source "${cachePath}"`;
return `test -f "${cachePath}"; and source "${cachePath}"`;
}
return `source "${cachePath}"`;
return `[ -f "${cachePath}" ] && source "${cachePath}"`;
}
function isCompletionProfileHeader(line: string): boolean {