zinit icon indicating copy to clipboard operation
zinit copied to clipboard

Make variables created with param'name → value' be exported. Also

Open psprint opened this issue 1 year ago • 0 comments

Zinit can set temporary, local variables in the moment of loading a plugin, with param'name->value'. However, they aren't exported. This PR adds the -x option to the local … invocation to make variables created with param'name → value' be exported.

Also, it makes *.plugin.zsh files sourced if any for services plugin besides running *.service.plugin in background.

Motivation and Context

The motivation is to allow configuring a new service that I'm writing via a param'MAKE_SERVER_SRC_DIRS→~/github/mc', without a separate line in .zshrc.

Usage examples

zi service'make' `param'MAKE_SERVER_SRC_DIRS→~/github/mc'` for zservices/make-server

How Has This Been Tested?

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My change requires a change to the documentation.
  • [x] I have updated the documentation accordingly.
  • [ ] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

Update: I've expanded README.md with param'' description.

psprint avatar Sep 20 '22 16:09 psprint