Ask before uninstallng each unused module
instead of asking just once for all. Keep printing number of unused modules, even if zero.
This commit is contained in:
parent
3fe3ba2b48
commit
869a8f5f17
3 changed files with 33 additions and 18 deletions
|
@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
_No unreleased changes._
|
### Changed
|
||||||
|
|
||||||
|
- Ask before uninstalling each unused module, instead of asking just once for
|
||||||
|
all.
|
||||||
|
|
||||||
## [1.14.0] - 2024-06-25
|
## [1.14.0] - 2024-06-25
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
_zimfw_uninstall() {
|
_zimfw_uninstall() {
|
||||||
local zopt
|
if (( _zprintlevel <= 0 )); then
|
||||||
if (( _zprintlevel > 0 )) zopt=-v
|
command rm -rf ${_zunused_dirs} || return 1
|
||||||
if (( ${#_zunused_dirs} )); then
|
else
|
||||||
if (( _zprintlevel <= 0 )) || read -q "?Uninstall ${#_zunused_dirs} module(s) listed above [y/N]? "; then
|
local zunused_dir
|
||||||
_zimfw_print
|
print $'Found <%= bold %>'${#_zunused_dirs}$'<%= normal %> unused module(s).'
|
||||||
command rm -rf ${zopt} ${_zunused_dirs} || return 1
|
for zunused_dir in ${_zunused_dirs}; do
|
||||||
fi
|
if read -q "?Uninstall ${zunused_dir} [y/N]? "; then
|
||||||
|
print
|
||||||
|
command rm -rfv ${zunused_dir} || return 1
|
||||||
|
else
|
||||||
|
print
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
print 'Done with uninstall.'
|
||||||
fi
|
fi
|
||||||
_zimfw_print 'Done with uninstall.'
|
|
||||||
}
|
}
|
||||||
|
|
24
zimfw.zsh
24
zimfw.zsh
|
@ -462,7 +462,7 @@ _zimfw_compile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_zimfw_info() {
|
_zimfw_info() {
|
||||||
print -R 'zimfw version: '${_zversion}' (built at 2024-09-16 23:05:08 UTC, previous commit is ded640e)'
|
print -R 'zimfw version: '${_zversion}' (built at 2024-09-16 23:27:18 UTC, previous commit is 3fe3ba2)'
|
||||||
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 ZIM_HOME ZSH_VERSION; do
|
||||||
print -R ${(r.22....:.)zparam}${(P)zparam}
|
print -R ${(r.22....:.)zparam}${(P)zparam}
|
||||||
|
@ -470,15 +470,21 @@ _zimfw_info() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_zimfw_uninstall() {
|
_zimfw_uninstall() {
|
||||||
local zopt
|
if (( _zprintlevel <= 0 )); then
|
||||||
if (( _zprintlevel > 0 )) zopt=-v
|
command rm -rf ${_zunused_dirs} || return 1
|
||||||
if (( ${#_zunused_dirs} )); then
|
else
|
||||||
if (( _zprintlevel <= 0 )) || read -q "?Uninstall ${#_zunused_dirs} module(s) listed above [y/N]? "; then
|
local zunused_dir
|
||||||
_zimfw_print
|
print $'Found \E[1m'${#_zunused_dirs}$'\E[0m unused module(s).'
|
||||||
command rm -rf ${zopt} ${_zunused_dirs} || return 1
|
for zunused_dir in ${_zunused_dirs}; do
|
||||||
fi
|
if read -q "?Uninstall ${zunused_dir} [y/N]? "; then
|
||||||
|
print
|
||||||
|
command rm -rfv ${zunused_dir} || return 1
|
||||||
|
else
|
||||||
|
print
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
print 'Done with uninstall.'
|
||||||
fi
|
fi
|
||||||
_zimfw_print 'Done with uninstall.'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_zimfw_upgrade() {
|
_zimfw_upgrade() {
|
||||||
|
|
Loading…
Reference in a new issue