Further clean up and simplify code
@startup_files_glob is not used anymore.
This commit is contained in:
parent
2491856a7b
commit
92bfa96993
4 changed files with 12 additions and 13 deletions
|
@ -164,11 +164,11 @@ Initialization options:
|
|||
local -ra prezto_scripts=(${zdir}/init.zsh(N))
|
||||
if (( ${#zfpaths} && ${#prezto_scripts} )); then
|
||||
# this follows the prezto module format, no need to check for other scripts
|
||||
zcmds=("source ${^prezto_scripts[@]:A}")
|
||||
zcmds=('source '${^prezto_scripts:A})
|
||||
else
|
||||
# get script with largest size (descending `O`rder by `L`ength, and return only `[1]` first)
|
||||
local -ra zscripts=(${zdir}/(init.zsh|${zmodule:t}.(zsh|plugin.zsh|zsh-theme|sh))(NOL[1]))
|
||||
zcmds=("source ${^zscripts[@]:A}")
|
||||
zcmds=('source '${^zscripts:A})
|
||||
fi
|
||||
fi
|
||||
if (( ! ${#zfpaths} && ! ${#zfunctions} && ! ${#zcmds} )); then
|
||||
|
|
|
@ -19,8 +19,8 @@ _zimfw_run_list() {
|
|||
# Match and remove the current module prefix from _zfpaths, _zfunctions and _zcmds
|
||||
local -r zpre=${zmodule}$'\0'
|
||||
local -r zfpaths=(${${(M)_zfpaths:#${zpre}*}#${zpre}}) zfunctions=(${${(M)_zfunctions:#${zpre}*}#${zpre}}) zcmds=(${${(M)_zcmds:#${zpre}*}#${zpre}})
|
||||
if (( ${#zfpaths} )) print -R " fpath: ${zfpaths[@]}"
|
||||
if (( ${#zfunctions} )) print -R " autoload: ${zfunctions[@]}"
|
||||
if (( ${#zcmds} )) print -R " cmd: ${(j:; :)zcmds[@]}"
|
||||
if (( ${#zfpaths} )) print -R ' fpath: '${zfpaths}
|
||||
if (( ${#zfunctions} )) print -R ' autoload: '${zfunctions}
|
||||
if (( ${#zcmds} )) print -R ' cmd: '${(j:; :)zcmds}
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<%
|
||||
class Zim
|
||||
attr_reader :version, :home, :min_zsh_version, :startup_files_glob, :url_regex,
|
||||
attr_reader :version, :home, :min_zsh_version, :url_regex,
|
||||
:clear_line, :ellipsis, :okay, :warn, :error, :done, :failed
|
||||
|
||||
def initialize
|
||||
@version = "1.7.0-SNAPSHOT"
|
||||
@home = "${ZDOTDIR:-${HOME}}"
|
||||
@min_zsh_version = "5.2"
|
||||
@startup_files_glob = ".z(shenv|profile|shrc|login|logout)"
|
||||
# Matches {ssh,http,https,git}://{user@,}host/org/repo and {user@,}host:org/repo
|
||||
# but not file:///path/to/repo or /path/to/repo
|
||||
# ${match[3]} contains host, and ${match[4]} contains org/repo
|
||||
|
|
12
zimfw.zsh
12
zimfw.zsh
|
@ -249,11 +249,11 @@ Initialization options:
|
|||
local -ra prezto_scripts=(${zdir}/init.zsh(N))
|
||||
if (( ${#zfpaths} && ${#prezto_scripts} )); then
|
||||
# this follows the prezto module format, no need to check for other scripts
|
||||
zcmds=("source ${^prezto_scripts[@]:A}")
|
||||
zcmds=('source '${^prezto_scripts:A})
|
||||
else
|
||||
# get script with largest size (descending `O`rder by `L`ength, and return only `[1]` first)
|
||||
local -ra zscripts=(${zdir}/(init.zsh|${zmodule:t}.(zsh|plugin.zsh|zsh-theme|sh))(NOL[1]))
|
||||
zcmds=("source ${^zscripts[@]:A}")
|
||||
zcmds=('source '${^zscripts:A})
|
||||
fi
|
||||
fi
|
||||
if (( ! ${#zfpaths} && ! ${#zfunctions} && ! ${#zcmds} )); then
|
||||
|
@ -352,7 +352,7 @@ _zimfw_compile() {
|
|||
}
|
||||
|
||||
_zimfw_info() {
|
||||
print -R 'zimfw version: '${_zversion}' (built at 2022-01-10 16:15:12 UTC, previous commit is cfc955c)'
|
||||
print -R 'zimfw version: '${_zversion}' (built at 2022-01-11 16:25:04 UTC, previous commit is 2491856)'
|
||||
print -R 'ZIM_HOME: '${ZIM_HOME}
|
||||
print -R 'Zsh version: '${ZSH_VERSION}
|
||||
print -R 'System info: '$(command uname -a)
|
||||
|
@ -420,9 +420,9 @@ _zimfw_run_list() {
|
|||
# Match and remove the current module prefix from _zfpaths, _zfunctions and _zcmds
|
||||
local -r zpre=${zmodule}$'\0'
|
||||
local -r zfpaths=(${${(M)_zfpaths:#${zpre}*}#${zpre}}) zfunctions=(${${(M)_zfunctions:#${zpre}*}#${zpre}}) zcmds=(${${(M)_zcmds:#${zpre}*}#${zpre}})
|
||||
if (( ${#zfpaths} )) print -R " fpath: ${zfpaths[@]}"
|
||||
if (( ${#zfunctions} )) print -R " autoload: ${zfunctions[@]}"
|
||||
if (( ${#zcmds} )) print -R " cmd: ${(j:; :)zcmds[@]}"
|
||||
if (( ${#zfpaths} )) print -R ' fpath: '${zfpaths}
|
||||
if (( ${#zfunctions} )) print -R ' autoload: '${zfunctions}
|
||||
if (( ${#zcmds} )) print -R ' cmd: '${(j:; :)zcmds}
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue