8000 Prioritise replacing `${ZIM_HOME}` over `${HOME}` in generated `${ZIM_HOME}/init.sh` · Issue #552 · zimfw/zimfw · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Prioritise replacing ${ZIM_HOME} over ${HOME} in generated ${ZIM_HOME}/init.sh #552
Open
@yxtay

Description

@yxtay

Is your feature request related to a problem? Please describe.

This is probably nitpicking enhancement rather than a feature request or a bug.

I note that in zimfw.zsh, paths with ${HOME} values are replaced with the variable names in the generated ${ZIM_HOME}/init.sh. But it looks like in most of the cases, replacing ${ZIM_HOME} is probably more appropriate.

print -R 'if [[ -e ${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} ]] zimfw() { source '${${(qqq)__ZIMFW_FILE}/${HOME}/\${HOME}}' "${@}" }'

zimfw.zsh is in ${ZIM_HOME} by default.

if (( ${#_zfpaths} )) print -R 'fpath=('${${(qqq)${_zfpaths#${~zpre}}:a}/${HOME}/\${HOME}}' ${fpath})'

Downloaded modules are likely to be in ${ZIM_HOME}, unless a local module is used.

zimfw/zimfw.zsh

Line 374 in 8ea4419

zcmds=(${zcmds//${HOME}/\${HOME}})

Downloaded modules are likely to be in ${ZIM_HOME}, unless a local module is used.

Describe the solution you'd like

For example, in the last case, instead of the following.

zcmds=(${zcmds//${HOME}/\${HOME}})

Use this so that cases for either ${ZIM_HOME} or ${HOME} will be handled.

zcmds=(${${zcmds//${ZIM_HOME}/\${ZIM_HOME}}//${HOME}/\${HOME}})

I have tried it on my ${fpath} locally and it works as expected.

This is a minor suggestion. I can make a PR if it is agreeable.

Describe alternatives you've considered

NA.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0