mirror of
https://github.com/zdharma-continuum/zinit.git
synced 2026-09-10 07:36:38 -04:00
fix: self-update check for updates (#562)
Signed-off-by: Doster, Vladislav <mvdoster@gmail.com>
This commit is contained in:
parent
19ca2dc361
commit
b456a2dba6
38
README.md
38
README.md
|
|
@ -9,8 +9,6 @@ # Zinit<a name="zinit"></a>
|
|||
[![MIT License][mit-badge]][mit-link] [![zinit version][ver-badge]][ver-link] [![zunit tests][tests-badge]][tests-link]
|
||||
[![Join the chat at https://gitter.im/zdharma-continuum/zinit][gitter-badge]][gitter-link]
|
||||
|
||||
[hello][gitter-link]
|
||||
|
||||
<!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=2 -->
|
||||
|
||||
- [Zinit Wiki](#zinit-wiki)
|
||||
|
|
@ -275,7 +273,7 @@ ### Turbo and lucid<a name="turbo-and-lucid"></a>
|
|||
|
||||
</details>
|
||||
|
||||
***F&A:*** What is `ice`?
|
||||
**_F&A:_** What is `ice`?
|
||||
|
||||
`ice` is zinit's options command. The option melts like ice and is used only once. (more:
|
||||
[Ice Modifiers](#ice-modifiers))
|
||||
|
|
@ -497,7 +495,7 @@ # PZTM Shorthand Syntax
|
|||
zi snippet PZTM::completion
|
||||
```
|
||||
|
||||
***F&A:*** What is `zstyle`?
|
||||
**_F&A:_** What is `zstyle`?
|
||||
|
||||
Read [zstyle](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fzutil-Module) doc (more:
|
||||
[What does `zstyle` do?](https://unix.stackexchange.com/questions/214657/what-does-zstyle-do)).
|
||||
|
|
@ -763,7 +761,7 @@ ### Sticky-Emulation Of Other Shells<a name="sticky-emulation-of-other-shells"><
|
|||
|
||||
| Modifier | Description |
|
||||
| :------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `sh`/`!sh` | Source the plugin's (or snippet's) script with `sh` emulation so that also all functions declared within the file will get a *sticky* emulation assigned – when invoked they'll execute also with the `sh` emulation set-up. The `!sh` version switches additional options that are rather not important from the portability perspective. |
|
||||
| `sh`/`!sh` | Source the plugin's (or snippet's) script with `sh` emulation so that also all functions declared within the file will get a _sticky_ emulation assigned – when invoked they'll execute also with the `sh` emulation set-up. The `!sh` version switches additional options that are rather not important from the portability perspective. |
|
||||
| `csh`/`!csh` | The same as `sh`, but emulating `csh` shell. |
|
||||
| `ksh`/`!ksh` | The same as `sh`, but emulating `ksh` shell. |
|
||||
| `bash`/`!bash` | The same as `sh`, but with the `SH_GLOB` option disabled, so that Bash regular expressions work. |
|
||||
|
|
@ -773,15 +771,15 @@ ### Others<a name="others"></a>
|
|||
| Modifier | Description |
|
||||
| :------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `as` | Can be `as"program"` (also the alias: `as"command"`), and will cause to add script/program to `$PATH` instead of sourcing (see `pick`). Can also be `as"completion"` – use with plugins or snippets in whose only underscore-starting `_*` files you are interested in. The third possible value is `as"null"` – a shorthand for `pick"/dev/null" nocompletions` – i.e.: it disables the default script-file sourcing and also the installation of completions. |
|
||||
| `link` | Use a symlink to cache a local snippet instead of copying into the snippets directory. Uses relative links if realpath >= 8.23 is found. ***Does not apply to URL-based snippets. Does not work with plugins.*** |
|
||||
| `link` | Use a symlink to cache a local snippet instead of copying into the snippets directory. Uses relative links if realpath >= 8.23 is found. **_Does not apply to URL-based snippets. Does not work with plugins._** |
|
||||
| `id-as` | Nickname a plugin or snippet, to e.g. create a short handler for long-url snippet. |
|
||||
| `subst` | Substitute the given string into another string when sourcing the plugin script, e.g.: `zinit subst'autoload → autoload -Uz' …`. |
|
||||
| `aliases` | Load the plugin with the aliases mechanism enabled. Use with plugins that define **and use** aliases in their scripts. |
|
||||
| `autoload` | Autoload the given functions (from their files). Equvalent to calling `atinit'autoload the-function'`. Supports renaming of the function – pass `'… → new-name'` or `'… -> new-name'`, e.g.: `zinit autoload'fun → my-fun; fun2 → my-fun2'`. |
|
||||
| `bindmap` | To hold `;`-separated strings like `Key(s)A -> Key(s)B`, e.g. `^R -> ^T; ^A -> ^B`. In general, `bindmap''`changes bindings (done with the `bindkey` builtin) the plugin does. The example would cause the plugin to map Ctrl-T instead of Ctrl-R, and Ctrl-B instead of Ctrl-A. **Does not work with snippets.** |
|
||||
| `compile` | Pattern (+ possible `{...}` expansion, like `{a/*,b*}`) to select additional files to compile, e.g. \`compile"(pure\\ |
|
||||
| `extract` | Performs archive extraction supporting multiple formats like `zip`, `tar.gz`, etc. and also notably OS X `dmg` images. If it has no value, then it works in the *auto* mode – it automatically extracts all files of known archive extensions IF they aren't located deeper than in a sub-directory (this is to prevent extraction of some helper archive files, typically located somewhere deeper in the tree). If no such files will be found, then it extracts all found files of known **type** – the type is being read by the `file` Unix command. If not empty, then takes names of the files to extract. Refer to the Wiki page for further information. |
|
||||
| `service` | Make following plugin or snippet a *service*, which will be ran in background, and only in single Zshell instance. See [the zservice-\* repositories](https://github.com/orgs/zdharma-continuum/repositories?q=zservice-). |
|
||||
| `extract` | Performs archive extraction supporting multiple formats like `zip`, `tar.gz`, etc. and also notably OS X `dmg` images. If it has no value, then it works in the _auto_ mode – it automatically extracts all files of known archive extensions IF they aren't located deeper than in a sub-directory (this is to prevent extraction of some helper archive files, typically located somewhere deeper in the tree). If no such files will be found, then it extracts all found files of known **type** – the type is being read by the `file` Unix command. If not empty, then takes names of the files to extract. Refer to the Wiki page for further information. |
|
||||
| `service` | Make following plugin or snippet a _service_, which will be ran in background, and only in single Zshell instance. See [the zservice-\* repositories](https://github.com/orgs/zdharma-continuum/repositories?q=zservice-). |
|
||||
| `light-mode` | Load the plugin without the investigating, i.e.: as if it would be loaded with the `light` command. Useful for the for-syntax, where there is no `load` nor `light` subcommand |
|
||||
| `nocompile` | Don't try to compile `pick`-pointed files. If passed the exclamation mark (i.e. `nocompile'!'`), then do compile, but after `make''` and `atclone''` (useful if Makefile installs some scripts, to point `pick''` at the location of their installation). |
|
||||
| `trackbinds` | Shadow but only `bindkey` calls even with `zinit light ...`, i.e. even with investigating disabled (fast loading), to allow `bindmap` to remap the key-binds. The same effect has `zinit light -b ...`, i.e. additional `-b` option to the `light`-subcommand. **Does not work with snippets.** |
|
||||
|
|
@ -811,7 +809,7 @@ ### Loading and Unloading<a name="loading-and-unloading"></a>
|
|||
| :----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `load {plg-spec}` | Load plugin, can also receive absolute local path. |
|
||||
| `snippet [-f] {url}` | Source local or remote file (by direct URL). `-f` – don't use cache (force redownload). The URL can use the following shorthands: `PZT::` (Prezto), `PZTM::` (Prezto module), `OMZ::` (Oh My Zsh), `OMZP::` (OMZ plugin), `OMZL::` (OMZ library), `OMZT::` (OMZ theme), e.g.: `PZTM::environment`, `OMZP::git`, etc. |
|
||||
| `light [-b] {plg-spec}` | Light plugin load, without reporting/investigating. `-b` – investigate `bindkey`-calls only. There's also `light-mode` ice which can be used to induce the no-investigating (i.e.: *light*) loading, regardless of the command used. |
|
||||
| `light [-b] {plg-spec}` | Light plugin load, without reporting/investigating. `-b` – investigate `bindkey`-calls only. There's also `light-mode` ice which can be used to induce the no-investigating (i.e.: _light_) loading, regardless of the command used. |
|
||||
| `unload [-q] {plg-spec}` | Unload plugin loaded with `zinit load ...`. `-q` – quiet. |
|
||||
|
||||
### Completions<a name="completions-1"></a>
|
||||
|
|
@ -878,8 +876,8 @@ ### Other<a name="other"></a>
|
|||
| `ice <ice specification>` | Add ice to next command, argument is e.g. from"gitlab". |
|
||||
| `env-whitelist [-v] [-h] {env..}` | Allows to specify names (also patterns) of variables left unchanged during an unload. `-v` – verbose. |
|
||||
| `run` `[-l]` `[plugin]` `{command}` | Runs the given command in the given plugin's directory. If the option `-l` will be given then the plugin should be skipped – the option will cause the previous plugin to be reused. |
|
||||
| `delete {plg-spec}\|URL\|--clean\|--all` | Remove plugin or snippet from disk (good to forget wrongly passed ice-mods). <br> `--all` – purge.<br> `--clean` – delete plugins and snippets that are not loaded. |
|
||||
| `update [-q] [-r] {plg-spec}\|URL\|--all` | Git update plugin or snippet.<br> `--all` – update all plugins and snippets.<br> `-q` – quiet.<br> `-r` \| `--reset` – run `git reset --hard` / `svn revert` before pulling changes. |
|
||||
| `delete {plg-spec}\|URL\|--clean\|--all` | Remove plugin or snippet from disk (good to forget wrongly passed ice-mods). <br> `--all` – purge.<br> `--clean` – delete plugins and snippets that are not loaded. |
|
||||
| `update [-q] [-r] {plg-spec}\|URL\|--all` | Git update plugin or snippet.<br> `--all` – update all plugins and snippets.<br> `-q` – quiet.<br> `-r` \| `--reset` – run `git reset --hard` / `svn revert` before pulling changes. |
|
||||
| `add-fpath\|fpath` `[-f\|--front]` `{plg-spec}` `[subdirectory]` | Adds given plugin (not yet snippet) directory to `$fpath`. If the second argument is given, it is appended to the directory path. If the option `-f`/`--front` is given, the directory path is prepended instead of appended to `$fpath`. The `{plg-spec}` can be absolute path, i.e.: it's possible to also add regular directories. |
|
||||
|
||||
## Updating Zinit and Plugins<a name="updating-zinit-and-plugins"></a>
|
||||
|
|
@ -914,7 +912,7 @@ ### Calling `compinit` Without Turbo Mode<a name="calling-compinit-without-turbo
|
|||
|
||||
The `compdef` function is provided by `compinit` call. As it should be called later, after loading all of the plugins,
|
||||
Zinit provides its own `compdef` function that catches (i.e.: records in an array) the arguments of the call, so that
|
||||
the loaded plugins can freely call `compdef`. Then, the `cdreplay` (*compdef-replay*) can be used, after `compinit` will
|
||||
the loaded plugins can freely call `compdef`. Then, the `cdreplay` (_compdef-replay_) can be used, after `compinit` will
|
||||
be called (and the original `compdef` function will become available), to execute all detected `compdef` calls. To
|
||||
summarize:
|
||||
|
||||
|
|
@ -1021,17 +1019,22 @@ ## Zinit Module<a name="zinit-module"></a>
|
|||
|
||||
## Hints and Tips<a name="hints-and-tips"></a>
|
||||
|
||||
### Using ZPFX variable
|
||||
### Using ZPFX variable<a name="using-zpfx-variable"></a>
|
||||
|
||||
Zinit uses a special, short named variable `$ZPFX` to denote a standard "prefix" for installing compiled software. Such, commonly used, prefixes are usually, e.g.: `/usr/`,`/usr/local` or `$HOME/.local`. Basically, when one would want to explain what a prefix-dir is in one sentence, it would be something like: a root directory, under which `…/bin`,`…/share`, `…/lib` sub-dirs are populated with installed binaries, data-files, libraries, etc.
|
||||
Zinit uses a special, short named variable `$ZPFX` to denote a standard "prefix" for installing compiled software. Such,
|
||||
commonly used, prefixes are usually, e.g.: `/usr/`,`/usr/local` or `$HOME/.local`. Basically, when one would want to
|
||||
explain what a prefix-dir is in one sentence, it would be something like: a root directory, under which
|
||||
`…/bin`,`…/share`, `…/lib` sub-dirs are populated with installed binaries, data-files, libraries, etc.
|
||||
|
||||
How to use the variable? It is automatically exploited when using `configure''` and `make''` ices, and user doesn't have to take any actions. This means that the `configure` command that'll be run will be:
|
||||
How to use the variable? It is automatically exploited when using `configure''` and `make''` ices, and user doesn't have
|
||||
to take any actions. This means that the `configure` command that'll be run will be:
|
||||
|
||||
```zsh
|
||||
./configure --prefix=$ZPFX
|
||||
```
|
||||
|
||||
The default location used for `$ZPFX` is: `~/.local/share/zinit/polaris`. You can, for example, set it to `$HOME/.local` to have the software installed with `configure''` and `make''` ices installed to that directory.
|
||||
The default location used for `$ZPFX` is: `~/.local/share/zinit/polaris`. You can, for example, set it to `$HOME/.local`
|
||||
to have the software installed with `configure''` and `make''` ices installed to that directory.
|
||||
|
||||
Typical use cases when working with `$ZPFX` are, e.g.:
|
||||
|
||||
|
|
@ -1063,7 +1066,8 @@ # (supported are: configure, cmake, scons and meson)
|
|||
$ export ZPFX=$HOME/my-software # or: ZPFX=$HOME/.local, etc.
|
||||
```
|
||||
|
||||
We encourage people to install compiled software with use of `$ZPFX` and `configure''` and `make''` ices, to have a nice, clean user-home dir based setup.
|
||||
We encourage people to install compiled software with use of `$ZPFX` and `configure''` and `make''` ices, to have a
|
||||
nice, clean user-home dir based setup.
|
||||
|
||||
### Customizing Paths<a name="customizing-paths"></a>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ zinit-autoload.zsh - a shell script
|
|||
Documentation automatically generated with `zshelldoc'
|
||||
|
||||
== FUNCTIONS
|
||||
.zi-check-for-git-changes
|
||||
.zinit-any-to-uspl2
|
||||
.zinit-at-eval
|
||||
.zinit-build-module
|
||||
|
|
@ -80,6 +81,25 @@ Has 5 line(s). No functions are called (may set up e.g. a hook, a Zle widget bou
|
|||
|
||||
Uses feature(s): _source_
|
||||
|
||||
==== .zi-check-for-git-changes
|
||||
|
||||
____
|
||||
|
||||
Check for Git updates
|
||||
|
||||
$1 - Absolute path to Git repository"
|
||||
|
||||
____
|
||||
|
||||
Has 12 line(s). Calls functions:
|
||||
|
||||
.zi-check-for-git-changes
|
||||
`-- zinit.zsh/+zi-log
|
||||
|
||||
Called by:
|
||||
|
||||
.zinit-self-update
|
||||
|
||||
==== .zinit-any-to-uspl2
|
||||
|
||||
____
|
||||
|
|
@ -1055,9 +1075,11 @@ ____
|
|||
|
||||
____
|
||||
|
||||
Has 42 line(s). Calls functions:
|
||||
Has 44 line(s). Calls functions:
|
||||
|
||||
.zinit-self-update
|
||||
|-- .zi-check-for-git-changes
|
||||
| `-- zinit.zsh/+zi-log
|
||||
|-- .zinit-pager
|
||||
|-- zinit.zsh/+zi-log
|
||||
`-- zinit.zsh/.zinit-get-mtime-into
|
||||
|
|
@ -1500,6 +1522,8 @@ Has 133 line(s). Calls functions:
|
|||
|
||||
.zinit-update-or-status-all
|
||||
|-- .zinit-self-update
|
||||
| |-- .zi-check-for-git-changes
|
||||
| | `-- zinit.zsh/+zi-log
|
||||
| |-- .zinit-pager
|
||||
| |-- zinit.zsh/+zi-log
|
||||
| `-- zinit.zsh/.zinit-get-mtime-into
|
||||
|
|
|
|||
|
|
@ -240,6 +240,7 @@ Called by:
|
|||
zinit-additional.zsh/.zinit-debug-status
|
||||
zinit-additional.zsh/.zinit-debug-stop
|
||||
zinit-additional.zsh/:zinit-tmp-subst-source
|
||||
zinit-autoload.zsh/.zi-check-for-git-changes
|
||||
zinit-autoload.zsh/.zinit-build-module
|
||||
zinit-autoload.zsh/.zinit-cd
|
||||
zinit-autoload.zsh/.zinit-confirm
|
||||
|
|
|
|||
|
|
@ -43,5 +43,10 @@
|
|||
assert $output contains 'Loaded: '
|
||||
assert $state equals 0
|
||||
}
|
||||
@test 'self-update' {
|
||||
run zinit self-update
|
||||
assert $output contains 'Already up-to-date.'
|
||||
assert $state equals 0
|
||||
}
|
||||
|
||||
# vim:ft=zsh:sw=2:sts=2:et:foldmarker={,}:foldmethod=marker
|
||||
|
|
|
|||
|
|
@ -1780,62 +1780,83 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
|
|||
fi
|
||||
done
|
||||
} # ]]]
|
||||
|
||||
# FUNCTION: .zi-check-for-git-changes [[[
|
||||
# Check for Git updates
|
||||
#
|
||||
# $1 - Absolute path to Git repository"
|
||||
.zi-check-for-git-changes() {
|
||||
+zi-log "{dbg} checking $1"
|
||||
if command git --work-tree "$1" rev-parse --is-inside-work-tree &> /dev/null; then
|
||||
if command git --work-tree "$1" rev-parse --abbrev-ref @'{u}' &> /dev/null; then
|
||||
local count="$(command git --work-tree "$1" rev-list --left-right --count HEAD...@'{u}' 2> /dev/null)"
|
||||
local down="$count[(w)2]"
|
||||
if [[ $down -gt 0 ]]; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
builtin print -P -- "Already up-to-date."
|
||||
return 1
|
||||
fi
|
||||
} # ]]]
|
||||
# FUNCTION: .zinit-self-update [[[
|
||||
# Updates Zinit code (does a git pull)
|
||||
.zinit-self-update() {
|
||||
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
|
||||
setopt extendedglob typesetsilent warncreateglobal
|
||||
|
||||
[[ $1 = -q ]] && +zi-log "{pre}[self-update]{info} updating zinit repository{msg2}" \
|
||||
if .zi-check-for-git-changes "$ZINIT[BIN_DIR]"; then
|
||||
[[ $1 = -q ]] && +zi-log "{pre}[self-update]{info} updating zinit repository{msg2}" \
|
||||
|
||||
local nl=$'\n' escape=$'\x1b['
|
||||
local current_branch=$(git -C $ZINIT[BIN_DIR] rev-parse --abbrev-ref HEAD)
|
||||
# local current_branch='main'
|
||||
local -a lines
|
||||
(
|
||||
builtin cd -q "$ZINIT[BIN_DIR]" \
|
||||
&& +zi-log -n "{pre}[self-update]{info} fetching latest changes from {obj}$current_branch{info} branch$nl{rst}" \
|
||||
&& command git fetch --quiet \
|
||||
&& lines=( ${(f)"$(command git log --color --date=short --pretty=format:'%Cgreen%cd %h %Creset%s %Cred%d%Creset || %b' ..origin/HEAD)"} )
|
||||
if (( ${#lines} > 0 )); then
|
||||
# Remove the (origin/main ...) segments, to expect only tags to appear
|
||||
lines=( "${(S)lines[@]//\(([,[:blank:]]#(origin|HEAD|master|main)[^a-zA-Z]##(HEAD|origin|master|main)[,[:blank:]]#)#\)/}" )
|
||||
# Remove " ||" if it ends the line (i.e. no additional text from the body)
|
||||
lines=( "${lines[@]/ \|\|[[:blank:]]#(#e)/}" )
|
||||
# If there's no ref-name, 2 consecutive spaces occur - fix this
|
||||
lines=( "${lines[@]/(#b)[[:space:]]#\|\|[[:space:]]#(*)(#e)/|| ${match[1]}}" )
|
||||
lines=( "${lines[@]/(#b)$escape([0-9]##)m[[:space:]]##${escape}m/$escape${match[1]}m${escape}m}" )
|
||||
# Replace what follows "|| ..." with the same thing but with no
|
||||
# newlines, and also only first 10 words (the (w)-flag enables
|
||||
# word-indexing)
|
||||
lines=( "${lines[@]/(#b)[[:blank:]]#\|\|(*)(#e)/| ${${match[1]//$nl/ }[(w)1,(w)10]}}" )
|
||||
builtin print -rl -- "${lines[@]}" | .zinit-pager
|
||||
builtin print
|
||||
fi
|
||||
local nl=$'\n' escape=$'\x1b['
|
||||
local current_branch=$(git -C $ZINIT[BIN_DIR] rev-parse --abbrev-ref HEAD)
|
||||
# local current_branch='main'
|
||||
local -a lines
|
||||
(
|
||||
builtin cd -q "$ZINIT[BIN_DIR]" \
|
||||
&& +zi-log -n "{pre}[self-update]{info} fetching latest changes from {obj}$current_branch{info} branch$nl{rst}" \
|
||||
&& command git fetch --quiet \
|
||||
&& lines=( ${(f)"$(command git log --color --date=short --pretty=format:'%Cgreen%cd %h %Creset%s %Cred%d%Creset || %b' ..origin/HEAD)"} )
|
||||
if (( ${#lines} > 0 )); then
|
||||
# Remove the (origin/main ...) segments, to expect only tags to appear
|
||||
lines=( "${(S)lines[@]//\(([,[:blank:]]#(origin|HEAD|master|main)[^a-zA-Z]##(HEAD|origin|master|main)[,[:blank:]]#)#\)/}" )
|
||||
# Remove " ||" if it ends the line (i.e. no additional text from the body)
|
||||
lines=( "${lines[@]/ \|\|[[:blank:]]#(#e)/}" )
|
||||
# If there's no ref-name, 2 consecutive spaces occur - fix this
|
||||
lines=( "${lines[@]/(#b)[[:space:]]#\|\|[[:space:]]#(*)(#e)/|| ${match[1]}}" )
|
||||
lines=( "${lines[@]/(#b)$escape([0-9]##)m[[:space:]]##${escape}m/$escape${match[1]}m${escape}m}" )
|
||||
# Replace what follows "|| ..." with the same thing but with no
|
||||
# newlines, and also only first 10 words (the (w)-flag enables
|
||||
# word-indexing)
|
||||
lines=( "${lines[@]/(#b)[[:blank:]]#\|\|(*)(#e)/| ${${match[1]//$nl/ }[(w)1,(w)10]}}" )
|
||||
builtin print -rl -- "${lines[@]}" | .zinit-pager
|
||||
builtin print
|
||||
fi
|
||||
if [[ $1 != -q ]] {
|
||||
command git pull --no-stat --ff-only origin main
|
||||
} else {
|
||||
command git pull --no-stat --quiet --ff-only origin main
|
||||
}
|
||||
)
|
||||
if [[ $1 != -q ]] {
|
||||
command git pull --no-stat --ff-only origin main
|
||||
} else {
|
||||
command git pull --no-stat --quiet --ff-only origin main
|
||||
+zi-log "{pre}[self-update]{info} compiling zinit via {obj}zcompile{rst}"
|
||||
}
|
||||
)
|
||||
if [[ $1 != -q ]] {
|
||||
+zi-log "{pre}[self-update]{info} compiling zinit via {obj}zcompile{rst}"
|
||||
}
|
||||
command rm -f $ZINIT[BIN_DIR]/*.zwc(DN)
|
||||
zcompile -U $ZINIT[BIN_DIR]/zinit.zsh
|
||||
zcompile -U $ZINIT[BIN_DIR]/zinit-{'side','install','autoload','additional'}.zsh
|
||||
zcompile -U $ZINIT[BIN_DIR]/share/git-process-output.zsh
|
||||
# Load for the current session
|
||||
[[ $1 != -q ]] && +zi-log "{pre}[self-update]{info} reloading zinit for the current session{rst}"
|
||||
command rm -f $ZINIT[BIN_DIR]/*.zwc(DN)
|
||||
zcompile -U $ZINIT[BIN_DIR]/zinit.zsh
|
||||
zcompile -U $ZINIT[BIN_DIR]/zinit-{'side','install','autoload','additional'}.zsh
|
||||
zcompile -U $ZINIT[BIN_DIR]/share/git-process-output.zsh
|
||||
# Load for the current session
|
||||
[[ $1 != -q ]] && +zi-log "{pre}[self-update]{info} reloading zinit for the current session{rst}"
|
||||
|
||||
# +zi-log "{pre}[self-update]{info} resetting zinit repository via{rst}: {cmd}${ICE[reset]:-git reset --hard HEAD}{rst}"
|
||||
source $ZINIT[BIN_DIR]/zinit.zsh
|
||||
zcompile -U $ZINIT[BIN_DIR]/zinit-{'side','install','autoload'}.zsh
|
||||
# Read and remember the new modification timestamps
|
||||
local file
|
||||
for file ( "" -side -install -autoload ) {
|
||||
.zinit-get-mtime-into "${ZINIT[BIN_DIR]}/zinit$file.zsh" "ZINIT[mtime$file]"
|
||||
}
|
||||
# +zi-log "{pre}[self-update]{info} resetting zinit repository via{rst}: {cmd}${ICE[reset]:-git reset --hard HEAD}{rst}"
|
||||
source $ZINIT[BIN_DIR]/zinit.zsh
|
||||
zcompile -U $ZINIT[BIN_DIR]/zinit-{'side','install','autoload'}.zsh
|
||||
# Read and remember the new modification timestamps
|
||||
local file
|
||||
for file ( "" -side -install -autoload ) {
|
||||
.zinit-get-mtime-into "${ZINIT[BIN_DIR]}/zinit$file.zsh" "ZINIT[mtime$file]"
|
||||
}
|
||||
fi
|
||||
} # ]]]
|
||||
|
||||
# FUNCTION: .zinit-show-all-reports [[[
|
||||
|
|
|
|||
Loading…
Reference in a new issue