1
0
Fork 0
mirror of synced 2024-12-25 23:43:20 -05:00

Rename zimfw action clean-modules to uninstall

and have `zimfw clean` only do `clean-compiled` and `clean-dumpfile`.
Semantically, it makes much more sense because we will be then cleaning
temporary files that are later compiled/generated again, which is not
the case for a module (which we'll be uninstalling now instead of
cleaning).
This commit is contained in:
Eric Nielsen 2019-12-10 18:19:01 -05:00
parent 196a0585f7
commit 7139771ec6
No known key found for this signature in database
GPG key ID: 47D1DBFA0765A1FB
3 changed files with 22 additions and 24 deletions

View file

@ -1,4 +1,4 @@
_zimfw_clean_modules() {
_zimfw_uninstall() {
local zopt zdir zmodule
(( ! _zquiet )) && zopt='-v'
for zdir in ${ZIM_HOME}/modules/*(N/); do
@ -9,6 +9,6 @@ _zimfw_clean_modules() {
fi
done
if (( ! _zquiet )); then
print -P '%F{green}✓%f Done with clean-modules.'
print -P '%F{green}✓%f Done with uninstall.'
fi
}

View file

@ -5,12 +5,12 @@ Usage: %B${0}%b <action> [%B-q%b]
Actions:
%Bbuild%b Build init.zsh
%Bclean%b Clean all (see below)
%Bclean-modules%b Clean unused modules
%Bclean-compiled%b Clean Zsh compiled files
%Bclean-dumpfile%b Clean completion dump file
%Bcompile%b Compile Zsh files
%Binfo%b Print Zim and system info
%Binstall%b Install new modules
%Buninstall%b Delete unused modules
%Bupdate%b Update current modules
%Bupgrade%b Upgrade <%= script_filename %>
@ -47,11 +47,9 @@ Options:
init) _zimfw_source_zimrc && _zimfw_build ;;
clean)
_zimfw_source_zimrc && \
_zimfw_clean_modules && \
_zimfw_clean_compiled && \
_zimfw_clean_dumpfile
;;
clean-modules) _zimfw_source_zimrc && _zimfw_clean_modules ;;
clean-compiled) _zimfw_clean_compiled ;;
clean-dumpfile) _zimfw_clean_dumpfile ;;
compile|login-init) _zimfw_source_zimrc && _zimfw_compile ${2} ;;
@ -64,6 +62,7 @@ Options:
fi && \
_zimfw_source_zimrc && _zimfw_build && _zimfw_compile ${2}
;;
uninstall) _zimfw_source_zimrc && _zimfw_uninstall ;;
upgrade) _zimfw_upgrade && _zimfw_compile ;;
*)
print -u2 -PR "%F{red}${0}: Unknown action ${1}%f"$'\n'${zusage}

View file

@ -234,21 +234,6 @@ _zimfw_source_zimrc() {
fi
}
_zimfw_clean_modules() {
local zopt zdir zmodule
(( ! _zquiet )) && zopt='-v'
for zdir in ${ZIM_HOME}/modules/*(N/); do
zmodule=${zdir:t}
# If _zmodules and _zdisableds do not contain the zmodule
if (( ! ${_zmodules[(I)${zmodule}]} && ! ${_zdisableds[(I)${zmodule}]} )); then
command rm -rf ${zopt} ${zdir} || return 1
fi
done
if (( ! _zquiet )); then
print -P '%F{green}✓%f Done with clean-modules.'
fi
}
_zimfw_clean_compiled() {
local zopt_find zopt_rm zdir
if (( ! _zquiet )); then
@ -279,12 +264,27 @@ _zimfw_clean_dumpfile() {
}
_zimfw_info() {
print 'Zim version: 1.0.0-SNAPSHOT (previous commit is 74404e6)'
print 'Zim version: 1.0.0-SNAPSHOT (previous commit is 69d609d)'
print -R 'ZIM_HOME: '${ZIM_HOME}
print -R 'Zsh version: '${ZSH_VERSION}
print -R 'System info: '$(command uname -a)
}
_zimfw_uninstall() {
local zopt zdir zmodule
(( ! _zquiet )) && zopt='-v'
for zdir in ${ZIM_HOME}/modules/*(N/); do
zmodule=${zdir:t}
# If _zmodules and _zdisableds do not contain the zmodule
if (( ! ${_zmodules[(I)${zmodule}]} && ! ${_zdisableds[(I)${zmodule}]} )); then
command rm -rf ${zopt} ${zdir} || return 1
fi
done
if (( ! _zquiet )); then
print -P '%F{green}✓%f Done with uninstall.'
fi
}
_zimfw_upgrade() {
local -r zscript=${ZIM_HOME}/zimfw.zsh
local -r zurl=https://raw.githubusercontent.com/zimfw/zimfw/develop/zimfw.zsh
@ -319,12 +319,12 @@ Usage: %B${0}%b <action> [%B-q%b]
Actions:
%Bbuild%b Build init.zsh
%Bclean%b Clean all (see below)
%Bclean-modules%b Clean unused modules
%Bclean-compiled%b Clean Zsh compiled files
%Bclean-dumpfile%b Clean completion dump file
%Bcompile%b Compile Zsh files
%Binfo%b Print Zim and system info
%Binstall%b Install new modules
%Buninstall%b Delete unused modules
%Bupdate%b Update current modules
%Bupgrade%b Upgrade zimfw.zsh
@ -441,11 +441,9 @@ fi
init) _zimfw_source_zimrc && _zimfw_build ;;
clean)
_zimfw_source_zimrc && \
_zimfw_clean_modules && \
_zimfw_clean_compiled && \
_zimfw_clean_dumpfile
;;
clean-modules) _zimfw_source_zimrc && _zimfw_clean_modules ;;
clean-compiled) _zimfw_clean_compiled ;;
clean-dumpfile) _zimfw_clean_dumpfile ;;
compile|login-init) _zimfw_source_zimrc && _zimfw_compile ${2} ;;
@ -458,6 +456,7 @@ fi
fi && \
_zimfw_source_zimrc && _zimfw_build && _zimfw_compile ${2}
;;
uninstall) _zimfw_source_zimrc && _zimfw_uninstall ;;
upgrade) _zimfw_upgrade && _zimfw_compile ;;
*)
print -u2 -PR "%F{red}${0}: Unknown action ${1}%f"$'\n'${zusage}