Update info action output and update README.md
Show the value of some relevant environment variables instead of calling uname, which might show private information like the host name. Other minor fixes regarding output.
This commit is contained in:
parent
b5703f9e17
commit
887bfd6a03
6 changed files with 30 additions and 23 deletions
11
README.md
11
README.md
|
@ -110,8 +110,8 @@ Add the lines below to your `~/.zshrc` file, in the following order:
|
|||
This is optional. If you choose to not include this step, you should manually
|
||||
download the `zimfw.zsh` script once and keep it at `${ZIM_HOME}`.
|
||||
|
||||
4. To automatically install missing modules and update the initialization script
|
||||
if missing or outdated:
|
||||
4. To automatically install missing modules and update the static initialization
|
||||
script if missing or outdated:
|
||||
```zsh
|
||||
# Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated.
|
||||
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
|
||||
|
@ -122,7 +122,7 @@ Add the lines below to your `~/.zshrc` file, in the following order:
|
|||
it, you must remember to manually run `zimfw install` every time after you
|
||||
update your [`~/.zimrc`](#create-zimrc) file.
|
||||
|
||||
5. To source the initialization script, that initializes your modules:
|
||||
5. To source the static script, that will initialize your modules:
|
||||
```zsh
|
||||
# Initialize modules.
|
||||
source ${ZIM_HOME}/init.zsh
|
||||
|
@ -166,8 +166,9 @@ define the modules you want to use.
|
|||
|
||||
Usage
|
||||
-----
|
||||
The `zimfw` plugin manager builds an initialization script, at `${ZIM_HOME}/init.zsh`,
|
||||
that initializes the modules you defined in your `~/.zimrc` file.
|
||||
The `zimfw` plugin manager installs your modules at `${ZIM_HOME}/modules`, and
|
||||
builds a static script at `${ZIM_HOME}/init.zsh` that will initialize them. Your
|
||||
modules are defined in your `~/.zimrc` file.
|
||||
|
||||
The `~/.zimrc` file must contain a `zmodule` call for each module you want to
|
||||
use. The modules will be initialized in the order they are defined.
|
||||
|
|
|
@ -5,7 +5,7 @@ _zimfw_version_check() {
|
|||
if [[ -w ${ztarget:h} && ! -f ${ztarget}(#qNm-30) ]]; then
|
||||
# Get latest version (get all `v*` tags from repo, delete `*v` from beginning,
|
||||
# sort in descending `O`rder `n`umerically, and get the `[1]` first)
|
||||
print ${${(On)${(f)"$(command git ls-remote --tags --refs \
|
||||
print -R ${${(On)${(f)"$(command git ls-remote --tags --refs \
|
||||
https://github.com/zimfw/zimfw.git 'v*' 2>/dev/null)"}##*v}[1]} >! ${ztarget} &!
|
||||
fi
|
||||
if [[ -f ${ztarget} ]]; then
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
_zimfw_info() {
|
||||
print -R 'zimfw version: '${_zversion}' (built at <%= Time.now.utc %>, previous commit is <%= `git rev-parse --short HEAD | tr -d '\r\n'` %>)'
|
||||
print -R 'ZIM_HOME: '${ZIM_HOME}
|
||||
print -R 'Zsh version: '${ZSH_VERSION}
|
||||
print -R 'System info: '$(command uname -a)
|
||||
print -R 'zimfw version: '${_zversion}' (built at <%= Time.now.utc %>, previous commit is <%= `git rev-parse --short HEAD | tr -d '\r\n'` %>)'
|
||||
print -R 'OSTYPE: '${OSTYPE}
|
||||
print -R 'TERM: '${TERM}
|
||||
print -R 'TERM_PROGRAM: '${TERM_PROGRAM}
|
||||
print -R 'TERM_PROGRAM_VERSION: '${TERM_PROGRAM_VERSION}
|
||||
print -R 'ZIM_HOME: '${ZIM_HOME}
|
||||
print -R 'ZSH_VERSION: '${ZSH_VERSION}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
_zimfw_run_tool() {
|
||||
local -r zname=${1}
|
||||
if [[ -z ${_zurls[${zname}]} ]]; then
|
||||
if (( _zprintlevel > 1 )) print -u2 -PR <%= clear_line %>"<%= okay %>%B${zname}:%b Skipping external module"
|
||||
if (( _zprintlevel > 1 )) print -PR <%= clear_line %>"<%= okay %>%B${zname}:%b Skipping external module"
|
||||
return 0
|
||||
fi
|
||||
if (( _zfrozens[${zname}] )); then
|
||||
if (( _zprintlevel > 1 )) print -u2 -PR <%= clear_line %>"<%= okay %>%B${zname}:%b Skipping frozen module"
|
||||
if (( _zprintlevel > 1 )) print -PR <%= clear_line %>"<%= okay %>%B${zname}:%b Skipping frozen module"
|
||||
return 0
|
||||
fi
|
||||
case ${_zargs_action} in
|
||||
install)
|
||||
if [[ -e ${_zdirs[${zname}]} ]]; then
|
||||
if (( _zprintlevel > 1 )) print -u2 -PR <%= clear_line %>"<%= okay %>%B${zname}:%b Skipping already installed module"
|
||||
if (( _zprintlevel > 1 )) print -PR <%= clear_line %>"<%= okay %>%B${zname}:%b Skipping already installed module"
|
||||
return 0
|
||||
fi
|
||||
_zimfw_print -nR <%= clear_line %>"Installing ${zname}<%= ellipsis %>"
|
||||
|
|
|
@ -4,7 +4,7 @@ class Zim
|
|||
:clear_line, :ellipsis, :okay, :warn, :error, :done, :failed
|
||||
|
||||
def initialize
|
||||
@version = "1.9.1"
|
||||
@version = "1.10.0-SNAPSHOT"
|
||||
@home = "${ZDOTDIR:-${HOME}}"
|
||||
@min_zsh_version = "5.2"
|
||||
# Matches {ssh,http,https,git}://{user@,}host/org/repo and {user@,}host:org/repo
|
||||
|
|
21
zimfw.zsh
21
zimfw.zsh
|
@ -317,7 +317,7 @@ _zimfw_version_check() {
|
|||
if [[ -w ${ztarget:h} && ! -f ${ztarget}(#qNm-30) ]]; then
|
||||
# Get latest version (get all `v*` tags from repo, delete `*v` from beginning,
|
||||
# sort in descending `O`rder `n`umerically, and get the `[1]` first)
|
||||
print ${${(On)${(f)"$(command git ls-remote --tags --refs \
|
||||
print -R ${${(On)${(f)"$(command git ls-remote --tags --refs \
|
||||
https://github.com/zimfw/zimfw.git 'v*' 2>/dev/null)"}##*v}[1]} >! ${ztarget} &!
|
||||
fi
|
||||
if [[ -f ${ztarget} ]]; then
|
||||
|
@ -384,10 +384,13 @@ _zimfw_compile() {
|
|||
}
|
||||
|
||||
_zimfw_info() {
|
||||
print -R 'zimfw version: '${_zversion}' (built at 2022-05-24 21:25:10 UTC, previous commit is 5bcfb8c)'
|
||||
print -R 'ZIM_HOME: '${ZIM_HOME}
|
||||
print -R 'Zsh version: '${ZSH_VERSION}
|
||||
print -R 'System info: '$(command uname -a)
|
||||
print -R 'zimfw version: '${_zversion}' (built at 2022-08-02 17:46:34 UTC, previous commit is b5703f9)'
|
||||
print -R 'OSTYPE: '${OSTYPE}
|
||||
print -R 'TERM: '${TERM}
|
||||
print -R 'TERM_PROGRAM: '${TERM_PROGRAM}
|
||||
print -R 'TERM_PROGRAM_VERSION: '${TERM_PROGRAM_VERSION}
|
||||
print -R 'ZIM_HOME: '${ZIM_HOME}
|
||||
print -R 'ZSH_VERSION: '${ZSH_VERSION}
|
||||
}
|
||||
|
||||
_zimfw_install_update() {
|
||||
|
@ -467,17 +470,17 @@ _zimfw_run_list() {
|
|||
_zimfw_run_tool() {
|
||||
local -r zname=${1}
|
||||
if [[ -z ${_zurls[${zname}]} ]]; then
|
||||
if (( _zprintlevel > 1 )) print -u2 -PR $'\E[2K\r'"%F{green})%f %B${zname}:%b Skipping external module"
|
||||
if (( _zprintlevel > 1 )) print -PR $'\E[2K\r'"%F{green})%f %B${zname}:%b Skipping external module"
|
||||
return 0
|
||||
fi
|
||||
if (( _zfrozens[${zname}] )); then
|
||||
if (( _zprintlevel > 1 )) print -u2 -PR $'\E[2K\r'"%F{green})%f %B${zname}:%b Skipping frozen module"
|
||||
if (( _zprintlevel > 1 )) print -PR $'\E[2K\r'"%F{green})%f %B${zname}:%b Skipping frozen module"
|
||||
return 0
|
||||
fi
|
||||
case ${_zargs_action} in
|
||||
install)
|
||||
if [[ -e ${_zdirs[${zname}]} ]]; then
|
||||
if (( _zprintlevel > 1 )) print -u2 -PR $'\E[2K\r'"%F{green})%f %B${zname}:%b Skipping already installed module"
|
||||
if (( _zprintlevel > 1 )) print -PR $'\E[2K\r'"%F{green})%f %B${zname}:%b Skipping already installed module"
|
||||
return 0
|
||||
fi
|
||||
_zimfw_print -nR $'\E[2K\r'"Installing ${zname} ..."
|
||||
|
@ -756,7 +759,7 @@ esac
|
|||
|
||||
zimfw() {
|
||||
builtin emulate -L zsh -o EXTENDED_GLOB
|
||||
local -r _zversion='1.9.1' zusage="Usage: %B${0}%b <action> [%B-q%b|%B-v%b]
|
||||
local -r _zversion='1.10.0-SNAPSHOT' zusage="Usage: %B${0}%b <action> [%B-q%b|%B-v%b]
|
||||
|
||||
Actions:
|
||||
%Bbuild%b Build %B${ZIM_HOME}/init.zsh%b and %B${ZIM_HOME}/login_init.zsh%b.
|
||||
|
|
Loading…
Reference in a new issue