]> arthur.barton.de Git - ax-zsh.git/blobdiff - bin/axzshctl
Implement "axttyinfo" command
[ax-zsh.git] / bin / axzshctl
index 79448341f3c051a3991d3a3b5175b1cb4116991a..405f955a0e93147114aaa26865da941769d209af 100755 (executable)
@@ -45,14 +45,24 @@ function Usage {
        echo
        echo "  upgrade"
        echo "    Upgrade AX-ZSH installation (requires Git)."
+       echo "  update-caches"
+       echo "    Force rebuild of all cache files."
        echo
        exit 2
 }
 
-function DropCache {
-       [[ -r "$AXZSH/cache" ]] \
-               && echo "Dropping caches ..."
-       rm -rf "$AXZSH/cache"
+function UpdatePluginCache {
+       [[ -r "$AXZSH/cache" ]] || return 0
+
+       ax_msg - "Updating plugin cache ..."
+       rm -rf \
+               $AXZSH/cache/zlogin.cache \
+               $AXZSH/cache/zlogout.cache \
+               $AXZSH/cache/zprofile.cache \
+               $AXZSH/cache/zshrc.cache \
+               || return 1
+       echo "Regenerating cache files ..."
+       zsh -ilc '' >/dev/null
 }
 
 function NormalizedPluginName {
@@ -327,14 +337,14 @@ case "$cmd" in
                for plugin in "$@"; do
                        EnablePlugin "$plugin"
                done
-               DropCache
+               UpdatePluginCache
                ;;
        "disable-plugin")
                [[ $# -gt 0 ]] || Usage
                for plugin in "$@"; do
                        DisablePlugin "$plugin"
                done
-               DropCache
+               UpdatePluginCache
                ;;
        "list-enabled")
                [[ $# -eq 0 ]] || Usage
@@ -344,12 +354,12 @@ case "$cmd" in
                [[ $# -eq 0 ]] || Usage
                ResetPlugins
                EnableDefaultPlugins
-               DropCache
+               UpdatePluginCache
                ;;
        "enable-default-plugins")
                [[ $# -eq 0 ]] || Usage
                EnableDefaultPlugins
-               DropCache
+               UpdatePluginCache
                ;;
        "check-plugins")
                [[ $# -eq 0 ]] || Usage
@@ -358,13 +368,17 @@ case "$cmd" in
        "set-theme")
                [[ $# -eq 1 ]] || Usage
                SetTheme "$1"
-               DropCache
+               UpdatePluginCache
                ;;
        "upgrade")
                [[ $# -eq 0 ]] || Usage
                UpgradeAXZSH
                UpgradeForeignPlugins
-               DropCache
+               UpdatePluginCache
+               ;;
+       "update-caches")
+               [[ $# -eq 0 ]] || Usage
+               UpdatePluginCache
                ;;
        *)
                Usage