diff --git a/CHANGELOG.md b/CHANGELOG.md index 13f8ecd..af719a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/stage2/29_zimfw_build_init.zsh.erb b/src/stage2/29_zimfw_build_init.zsh.erb index e0b26a8..820895f 100644 --- a/src/stage2/29_zimfw_build_init.zsh.erb +++ b/src/stage2/29_zimfw_build_init.zsh.erb @@ -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}} diff --git a/src/zimfw.zsh.erb b/src/zimfw.zsh.erb index 973ef8e..a63aab7 100644 --- a/src/zimfw.zsh.erb +++ b/src/zimfw.zsh.erb @@ -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 diff --git a/zimfw.zsh b/zimfw.zsh index 2d830d8..082673e 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -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