Skip to content

Commit

Permalink
got wrong path for zsh tab completion installation
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindberg committed Mar 10, 2023
1 parent 71ba6ad commit 24c6fc4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ case class InstallZshTabCompletions(userPaths: UserPaths, logger: Logger) extend
|}
|""".stripMargin

val completionScriptDest = userPaths.configDir / "zsh" / s"_$programName"
val completionScriptDir = userPaths.configDir / "zsh"
val completionScriptDest = completionScriptDir / s"_$programName"

logger.info(s"Writing $completionScriptDest")
FileSync.softWriteBytes(completionScriptDest, completionScript.getBytes(StandardCharsets.UTF_8))

val zshRc = Option(System.getenv("ZDOTDIR")).map(Path.of(_)).getOrElse(FileUtils.Home) / ".zshrc"

PatchRcFile(None, logger, zshRc)(
s"""fpath=("$completionScriptDest" $$fpath)
s"""fpath=("$completionScriptDir" $$fpath)
|compinit
|""".stripMargin
)
Expand Down

0 comments on commit 24c6fc4

Please sign in to comment.