summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2021-12-28 17:46:35 +0100
committerMarc Cornellà <hello@mcornella.com>2021-12-28 17:46:35 +0100
commitc4be9294f26a3cf58fc7f1b4e6cd43931c68b639 (patch)
treec2889efc7f8bed0663292892d11ccdd6a6f05640 /plugins
parentd806649028f60ee2efc4aac187faf252e32ba1ef (diff)
downloadzsh-c4be9294f26a3cf58fc7f1b4e6cd43931c68b639.tar.gz
zsh-c4be9294f26a3cf58fc7f1b4e6cd43931c68b639.tar.bz2
zsh-c4be9294f26a3cf58fc7f1b4e6cd43931c68b639.zip
style(acs): fix style and gitignore __pycache__ folder
Diffstat (limited to 'plugins')
-rw-r--r--plugins/aliases/.gitignore1
-rw-r--r--plugins/aliases/aliases.plugin.zsh9
2 files changed, 6 insertions, 4 deletions
diff --git a/plugins/aliases/.gitignore b/plugins/aliases/.gitignore
new file mode 100644
index 000000000..bee8a64b7
--- /dev/null
+++ b/plugins/aliases/.gitignore
@@ -0,0 +1 @@
+__pycache__
diff --git a/plugins/aliases/aliases.plugin.zsh b/plugins/aliases/aliases.plugin.zsh
index 28d8fba24..b3d9340f0 100644
--- a/plugins/aliases/aliases.plugin.zsh
+++ b/plugins/aliases/aliases.plugin.zsh
@@ -2,9 +2,10 @@
#
# - acs: alias cheatsheet
# group alias by command, pass addition argv to grep.
-ALIASES_PLUGIN_ROOT=$(cd `dirname $0` && pwd)
function acs(){
- which python >>/dev/null
- [[ $? -eq 1 ]] && echo "[error]no python executable detected!" && return
- alias | python $ALIASES_PLUGIN_ROOT/cheatsheet.py $@
+ (( $+commands[python] )) || {
+ echo "[error] No python executable detected"
+ return
+ }
+ alias | python ${functions_source[$0]:h}/cheatsheet.py $@
}