Show a more informative error when running zmodule

from the shell. This means getting

    zmodule: Must be called from ${ZDOTDIR:-${HOME}}/.zimrc

and the full zmodule usage, instead of getting

    zsh: command not found: zmodule

Fixes #430
pull/440/head
Eric Nielsen 2 years ago
parent b3b282f0f6
commit 7deda9c7f4
No known key found for this signature in database
GPG Key ID: 47D1DBFA0765A1FB
  1. 2
      CHANGELOG.md
  2. 1
      src/stage2/29_zimfw_build_init.zsh.erb
  3. 6
      src/zimfw.zsh.erb
  4. 9
      zimfw.zsh

@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Error in `zimfw update` with the `git` tool when module directory is under a
symlinked directory.
- Warning when `WARN_CREATE_GLOBAL` is set and `ZIM_HOME` is not.
- "zsh: command not found: zmodule" when trying to run `zmodule` from the shell.
Show a more informative error instead.
- Don't try to install or update external modules.
## [1.5.0] - 2021-08-10

@ -6,6 +6,7 @@ _zimfw_build_init() {
fi
_zimfw_mv =(
print -R "zimfw() { source ${ZIM_HOME}/zimfw.zsh \"\${@}\" }"
print -R "zmodule() { source ${ZIM_HOME}/zimfw.zsh \"\${@}\" }"
local -r zpre=$'*\0'
if (( ${#_zfpaths} )) print -R 'fpath=('${${_zfpaths#${~zpre}}:A}' ${fpath})'
if (( ${#_zfunctions} )) print -R 'autoload -Uz '${_zfunctions#${~zpre}}

@ -49,4 +49,8 @@ zim = Zim.new
<%= zim.render_commented("LICENSE") %>
<%= zim.render_all("src/stage2/*.erb") %>
zimfw "${@}"
if [[ ${functrace[1]} == zmodule:* ]]; then
zmodule "${@}"
else
zimfw "${@}"
fi

@ -59,6 +59,7 @@ _zimfw_build_init() {
fi
_zimfw_mv =(
print -R "zimfw() { source ${ZIM_HOME}/zimfw.zsh \"\${@}\" }"
print -R "zmodule() { source ${ZIM_HOME}/zimfw.zsh \"\${@}\" }"
local -r zpre=$'*\0'
if (( ${#_zfpaths} )) print -R 'fpath=('${${_zfpaths#${~zpre}}:A}' ${fpath})'
if (( ${#_zfunctions} )) print -R 'autoload -Uz '${_zfunctions#${~zpre}}
@ -367,7 +368,7 @@ _zimfw_compile() {
}
_zimfw_info() {
print -R 'zimfw version: '${_zversion}' (built at 2021-09-19 18:30:02 UTC, previous commit is 3e1a89a)'
print -R 'zimfw version: '${_zversion}' (built at 2021-09-21 01:00:09 UTC, previous commit is b3b282f)'
print -R 'ZIM_HOME: '${ZIM_HOME}
print -R 'Zsh version: '${ZSH_VERSION}
print -R 'System info: '$(command uname -a)
@ -781,4 +782,8 @@ Options:
esac
}
zimfw "${@}"
if [[ ${functrace[1]} == zmodule:* ]]; then
zmodule "${@}"
else
zimfw "${@}"
fi

Loading…
Cancel
Save