Skip to content

Fix migrate.zsh crash when Zinit is not installed#15

Open
alejandroqh wants to merge 1 commit intoquantumnic:masterfrom
alejandroqh:fix/migrate-zinit-nounset
Open

Fix migrate.zsh crash when Zinit is not installed#15
alejandroqh wants to merge 1 commit intoquantumnic:masterfrom
alejandroqh:fix/migrate-zinit-nounset

Conversation

@alejandroqh
Copy link

@alejandroqh alejandroqh commented Feb 23, 2026

Summary

  • migrate.zsh fails with PLUGINS_DIR: parameter not set on systems without Zinit
  • The script uses set -u (nounset), which causes ${ZINIT[PLUGINS_DIR]:-/dev/null} to error when the ZINIT associative array is undeclared
  • Fix: declare ZINIT as an associative array if not already set, so the :- fallback works as intended

Steps to reproduce

zsh <(curl -fsSL https://raw.githubusercontent.com/quantumnic/powerlevel10k/master/migrate.zsh)

  When ZINIT is not declared as an associative array (i.e. the user
  does not use Zinit), accessing ${ZINIT[PLUGINS_DIR]:-/dev/null}
  under set -u (nounset) causes zsh to abort with:

    PLUGINS_DIR: parameter not set

  Fix by declaring ZINIT as an associative array if it is not already
  set, so the :- fallback works as intended.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant