Install a zsh plugin manager on your Action
This action only install zinit, not zsh. So, you need to have zsh installed and ready to use first.
E.g. One of the easiest ways to do that (.github/workflows/test.yml#L7-L11) :
jobs:
test_run:
name: Test for action.yml
runs-on: ubuntu-latest
container: zshusers/zsh:5.8
We can use zshusers/zsh
via container
syntax. Just one line!
Thanks to zsh-users/zsh-docker and its maintainers!
You should have at least git
, subversion
and curl
installed for installing zinit itself and some plugins.
E.g. (.github/workflows/test.yml#L16-L20)
steps:
- name: Packages update and install
run: |
apt update && apt upgrade -y
apt install -y git subversion curl wget
Even if you give --rcs
option to shell: ...
, .zshrc
will not be loaded and you cannot use zinit.
Therefore, you must source
manually.
E.g. (.github/workflows/test.yml#L33)
source "${ZDOTDIR:-$HOME}/.zshrc"
In the step of executing zinit commands, shell: ...
with the -e/--errexit
flag may cause unexpected interruptions.
E.g. (.github/workflows/test.yml#L45)
shell: zsh -df --pipefail {0}
You can customize $ZINIT[*]
array and $ZPFX
via with
syntax.
By modifying this variables, you can control where zinit, plugins, and others are stored.
If nothing is specified, ${ZDOTDIR:-$HOME}/.zinit
will be used as the root by default.
Details: https://github.com/zdharma/zinit#customizing-paths
input | variable |
---|---|
zinit_home |
$ZINIT[HOME_DIR] |
zinit_bin |
$ZINIT[BIN_DIR] |
zinit_plugins |
$ZINIT[PLUGINS_DIR] |
zinit_completions |
$ZINIT[COMPLETIONS_DIR] |
zinit_snippets |
$ZINIT[SNIPPETS_DIR] |
zpfx |
$ZPFX |
All code in this repository is released under the MIT license.