[meta] add module and fixup tools
This commit is contained in:
parent
b7bc7bb69e
commit
f7d3cdf812
4 changed files with 54 additions and 2 deletions
18
modules/meta/README.md
Normal file
18
modules/meta/README.md
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
Meta
|
||||||
|
====
|
||||||
|
|
||||||
|
Provides aliases and functions for management of the zim framework, specifically `zmanage`
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
|
||||||
|
`zmanage [arg]`
|
||||||
|
|
||||||
|
| Action | Description |
|
||||||
|
| ----------- | --------------------------------------------------- |
|
||||||
|
| update | Fetches and merges upstream zim commits if possible |
|
||||||
|
| info | Prints zim and system info |
|
||||||
|
| clean-cache | Clean the zim cache |
|
||||||
|
| build-cache | Rebuild the zim cache |
|
||||||
|
| remove | *experimental* Remove zim as best we can |
|
||||||
|
| reset | Reset zim to the latest commit |
|
34
modules/meta/functions/zmanage
Normal file
34
modules/meta/functions/zmanage
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
usage="${0} [action]
|
||||||
|
Actions:
|
||||||
|
| update | Fetches and merges upstream zim commits if possible |
|
||||||
|
| info | Prints zim and system info |
|
||||||
|
| clean-cache | Clean the zim cache |
|
||||||
|
| build-cache | Rebuild the zim cache |
|
||||||
|
| remove | *experimental* Remove zim as best we can |
|
||||||
|
| reset | Reset zim to the latest commit |
|
||||||
|
| help | Print this usage message |"
|
||||||
|
|
||||||
|
if (( ${#} != 1 )); then
|
||||||
|
print ${usage}
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local tools
|
||||||
|
tools="${ZIM}/tools"
|
||||||
|
|
||||||
|
case ${1} in
|
||||||
|
update) zsh ${tools}/zim_update
|
||||||
|
;;
|
||||||
|
info) zsh ${tools}/zim_info
|
||||||
|
;;
|
||||||
|
clean-cache) zsh ${tools}/zim_clean_cache && print 'Cleaned cache'
|
||||||
|
;;
|
||||||
|
build-cache) source ${tools}/zim_build_cache && print 'Rebuilt cache'
|
||||||
|
;;
|
||||||
|
remove) zsh ${tools}/zim_remove
|
||||||
|
;;
|
||||||
|
reset) zsh ${tools}/zim_reset
|
||||||
|
;;
|
||||||
|
*) print ${usage}
|
||||||
|
;;
|
||||||
|
esac
|
|
@ -2,4 +2,4 @@
|
||||||
# zim_build_cache - rebuilds the zim cache
|
# zim_build_cache - rebuilds the zim cache
|
||||||
#
|
#
|
||||||
|
|
||||||
source ${ZDOTDIR:-${HOME}}/templates/zlogin
|
source ${ZDOTDIR:-${HOME}}/.zim/templates/zlogin
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# zim_update - update the zim repository
|
# zim_update - update the zim repository
|
||||||
#
|
#
|
||||||
|
|
||||||
cd ${ZIM}
|
cd ${ZDOTDIR:-${HOME}/.zim}
|
||||||
|
|
||||||
# this is the cleanest way I know of to update a repository
|
# this is the cleanest way I know of to update a repository
|
||||||
git remote update -p
|
git remote update -p
|
||||||
|
|
Loading…
Reference in a new issue