1
0
Fork 0
mirror of synced 2024-10-22 11:18:57 -04:00

Also output zimfw config and zimfw script paths

in info action, following symlinks if any.
This commit is contained in:
Eric Nielsen 2024-10-10 09:17:22 -05:00
parent 84c59ede0e
commit e8e26c1b13
No known key found for this signature in database
GPG key ID: 678AF5E338C87D99
5 changed files with 26 additions and 6 deletions

View file

@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
_No unreleased changes._ ### Added
- Also output zimfw config and zimfw.zsh script paths in `info` action,
following symlinks if any.
## [1.15.1] - 2024-10-10 ## [1.15.1] - 2024-10-10

View file

@ -1,7 +1,10 @@
_zimfw_info() { _zimfw_info() {
_zimfw_info_print_symlink 'zimfw config' ${_zconfig}
_zimfw_info_print_symlink ZIM_HOME ${ZIM_HOME}
_zimfw_info_print_symlink 'zimfw script' ${__ZIMFW_FILE}
print -R 'zimfw version: '${_zversion}' (built at <%= Time.now.utc %>, previous commit is <%= `git rev-parse --short HEAD | tr -d '\r\n'` %>)' print -R 'zimfw version: '${_zversion}' (built at <%= Time.now.utc %>, previous commit is <%= `git rev-parse --short HEAD | tr -d '\r\n'` %>)'
local zparam local zparam
for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZIM_HOME ZSH_VERSION; do for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZSH_VERSION; do
print -R ${(r.22....:.)zparam}${(P)zparam} print -R ${(r.22....:.)zparam}${(P)zparam}
done done
} }

View file

@ -0,0 +1,5 @@
_zimfw_info_print_symlink() {
print -Rn ${(r.22....:.)1}${2}
if [[ -L ${2} ]] print -Rn ' -> '${2:A}
print
}

View file

@ -4,7 +4,7 @@ class Zim
:bold, :normal, :red, :normalred, :yellow, :normalyellow, :clear_line, :ellipsis, :okay, :warn, :error :bold, :normal, :red, :normalred, :yellow, :normalyellow, :clear_line, :ellipsis, :okay, :warn, :error
def initialize def initialize
@version = "1.15.1" @version = "1.16.0-SNAPSHOT"
@home = "${ZDOTDIR:-${HOME}}" @home = "${ZDOTDIR:-${HOME}}"
@min_zsh_version = "5.2" @min_zsh_version = "5.2"
# Matches {ssh,http,https,git}://{user@,}host/org/repo and {user@,}host:org/repo # Matches {ssh,http,https,git}://{user@,}host/org/repo and {user@,}host:org/repo

View file

@ -467,13 +467,22 @@ _zimfw_compile() {
} }
_zimfw_info() { _zimfw_info() {
print -R 'zimfw version: '${_zversion}' (built at 2024-10-10 00:28:19 UTC, previous commit is 331f1c5)' _zimfw_info_print_symlink 'zimfw config' ${_zconfig}
_zimfw_info_print_symlink ZIM_HOME ${ZIM_HOME}
_zimfw_info_print_symlink 'zimfw script' ${__ZIMFW_FILE}
print -R 'zimfw version: '${_zversion}' (built at 2024-10-10 14:13:57 UTC, previous commit is 84c59ed)'
local zparam local zparam
for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZIM_HOME ZSH_VERSION; do for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZSH_VERSION; do
print -R ${(r.22....:.)zparam}${(P)zparam} print -R ${(r.22....:.)zparam}${(P)zparam}
done done
} }
_zimfw_info_print_symlink() {
print -Rn ${(r.22....:.)1}${2}
if [[ -L ${2} ]] print -Rn ' -> '${2:A}
print
}
_zimfw_uninstall() { _zimfw_uninstall() {
if (( _zprintlevel <= 0 )); then if (( _zprintlevel <= 0 )); then
command rm -rf ${_zunused_dirs} || return 1 command rm -rf ${_zunused_dirs} || return 1
@ -946,7 +955,7 @@ _zimfw_run_tool_action() {
zimfw() { zimfw() {
builtin emulate -L zsh -o EXTENDED_GLOB builtin emulate -L zsh -o EXTENDED_GLOB
local -r _zconfig=${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} _zversion='1.15.1' local -r _zconfig=${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} _zversion='1.16.0-SNAPSHOT'
local -r zusage=$'Usage: \E[1m'${0}$'\E[0m <action> [\E[1m-q\E[0m|\E[1m-v\E[0m] local -r zusage=$'Usage: \E[1m'${0}$'\E[0m <action> [\E[1m-q\E[0m|\E[1m-v\E[0m]
Actions: Actions: