]> arthur.barton.de Git - ax-zsh.git/commitdiff
ax.zsh: Initialize script name and type in the very beginning
authorAlexander Barton <alex@barton.de>
Sat, 18 Jul 2015 15:21:49 +0000 (17:21 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 18 Jul 2015 15:21:49 +0000 (17:21 +0200)
ax.zsh

diff --git a/ax.zsh b/ax.zsh
index d25a237e52f2667062a2b79cbfc3bdec69670bb6..5f8e662fe2a6c108e63854fc6b03041f4d913e19 100644 (file)
--- a/ax.zsh
+++ b/ax.zsh
@@ -1,6 +1,9 @@
 # AX-ZSH: Alex' Modular ZSH Configuration
 # Copyright (c) 2015 Alexander Barton <alex@barton.de>
 
+script_name="$(basename -- "${(%):-%N}")"
+script_type="$script_name[2,-1]"
+
 # Load plugin code of a given type.
 # - $1: plugin name
 # - $2: plugin type (optional; defaults to "zshrc")
@@ -81,8 +84,6 @@ plugin_list=(
 )
 
 # Read in all the plugins for the current "type":
-script_name="$(basename -- "${(%):-%N}")"
-script_type="$script_name[2,-1]"
 [[ -f "$HOME/.axzsh.debug" ]] && echo "ยป $script_name:"
 for plugin ($plugin_list); do
        axzsh_load_plugin "$(basename "$plugin")" "$script_type"