From 5ea79463e7d8384c9823dea0eae8c03a82e7c5d1 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker Date: Mon, 16 Sep 2024 16:55:52 -0700 Subject: [PATCH] Fix zsh dot dir fallback --- src/shell.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell.ts b/src/shell.ts index 162a29e8..dcec5307 100644 --- a/src/shell.ts +++ b/src/shell.ts @@ -155,7 +155,7 @@ export class Zsh implements UnixShell { "echo -n $ZDOTDIR", ]); const stdout = new TextDecoder().decode(output.stdout).trim(); - zshDotDir = stdout; + zshDotDir = stdout.length > 0 ? stdout : undefined; } return zshDotDir; @@ -189,7 +189,7 @@ export class Zsh implements UnixShell { const fpathSetup = `# Add deno completions to search path\nif [[ ":$FPATH:" != *":${completionDir}:"* ]]; then export FPATH="${completionDir}:$FPATH"; fi`; - const zshDotDir = await this.getZshDotDir() ?? homeDir; + const zshDotDir = (await this.getZshDotDir()) ?? homeDir; // try to figure out whether the user already has `compinit` being called let append: string | undefined;