z-shell / zi

✨ A Swiss Army Knife for Zsh - Unix Shell
https://wiki.zshell.dev
MIT License
750 stars 42 forks source link

[bug]: Oh-my-zsh plugins that use caching don't work #321

Open fireboy1919 opened 1 month ago

fireboy1919 commented 1 month ago

Environment

Linux

Reproduction steps

1.   Install a oh-my-zsh plugin that uses caching.  E.g. docker and last-working-dir

2.  Try using them.  In the case of last-working-dir, change directories.
   In the case of docker, just loading the prompt produces an error.

Expected behavior

They should work as expected.

Current behavior

The cache directory isn't defined, so the errors manifest as trying to save/load from a root directory.

Code snippet

zi wait lucid for \ OMZP::docker OMZP::last-working-dir

Additional information

I managed to fix this by adding this: mkdir -p ~$HOME/.cache/zi ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/zi"

This is not a problem in the original zinit, so this is a regression.

Obviously the solution is fairly simple: add a default cache dir variable when loading anything that comes from OMZP.

Self-service

Have you read the Contributing Guidelines?

Are you familiar with the Contributor Covenant Code of Conduct?

Contact Details

rusty.phillips@gmail.com