c4be9294f26a3cf58fc7f1b4e6cd43931c68b639

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

style(acs): fix style and gitignore __pycache__ folder

Diff

 1diff --git a/plugins/aliases/.gitignore b/plugins/aliases/.gitignore
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..bee8a64b79a99590d5303307144172cfe824fbf7
 4--- /dev/null
 5+++ b/plugins/aliases/.gitignore
 6@@ -0,0 +1 @@
 7+__pycache__
 8diff --git a/plugins/aliases/aliases.plugin.zsh b/plugins/aliases/aliases.plugin.zsh
 9index 28d8fba241d8882dc33faaff3f6acc375499cfc0..b3d9340f08db6e1942e8fd669dbf4847b22d5b88 100644
10--- a/plugins/aliases/aliases.plugin.zsh
11+++ b/plugins/aliases/aliases.plugin.zsh
12@@ -2,9 +2,10 @@
13 #
14 # - acs: alias cheatsheet
15 #   group alias by command, pass addition argv to grep.
16-ALIASES_PLUGIN_ROOT=$(cd `dirname $0` && pwd)
17 function acs(){
18-    which python >>/dev/null
19-    [[ $? -eq 1 ]] && echo "[error]no python executable detected!" && return
20-    alias | python $ALIASES_PLUGIN_ROOT/cheatsheet.py $@
21+  (( $+commands[python] )) || {
22+    echo "[error] No python executable detected"
23+    return
24+  }
25+  alias | python ${functions_source[$0]:h}/cheatsheet.py $@
26 }