zdharma-continuum / zinit-annex-readurl

Other
5 stars 7 forks source link

Fix check for function .zinit-setup-plugin-dir #19

Closed ngocphamm closed 1 year ago

ngocphamm commented 1 year ago

Description

Typo was made to this line, so the function contains spaces around the dashes. The script now cannot source zinit-install.zsh.

Motivation and Context

Related Issue(s)

Usage examples

How Has This Been Tested?

Manual

Types of changes

Checklist:

ngocphamm commented 1 year ago

@vladdoster Actually, my bad, but this doesn't work just yet 😦

(($ + functions[.zinit-setup-plugin-dir])) doesn't seem to be a valid check here. I'm not so sure what this is doing either I tried to search to gain more knowledge about shell/zsh but no luck understanding it yet.

My guess would be we want to check if the function .zinit-setup-plugin-dir exists before sourcing zinit-install.zsh, but that doesn't work here yet, even though I can confirm the following

  1. Execute echo $functions[.zinit-setup-params] prints out the method
  2. Execute echo $functions[.zinit-setup-plugin-dir] prints out blank

Both commands has exit code of 0 so might be that's the reason why.

Just a shot in the dark, I've tried changing it to the following without success

  1. (( type -f .zinit-setup-plugin-dir 2>/dev/null ))
  2. ( type -f .zinit-setup-plugin-dir 2>/dev/null )
  3. type -f .zinit-setup-plugin-dir 2>/dev/null
  4. (($functions[.zinit-setup-plugin-dir]))