-
Notifications
You must be signed in to change notification settings - Fork 2
/
z-a-bin-gem-node.plugin.zsh
executable file
·56 lines (46 loc) · 2.22 KB
/
z-a-bin-gem-node.plugin.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
#
# Annex bin-gem-node | Copyright Ⓒ 2022 Z-Shell Community
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Zsh Plugin Standard:
builtin emulate -L zsh ${=${options[xtrace]:#off}:+-o xtrace}
builtin setopt extended_glob warn_create_global typeset_silent no_short_loops rc_quotes no_auto_pushd
# https://z.digitalclouds.dev/community/zsh_plugin_standard/#zero-handling
0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}"
0="${${(M)0:#/*}:-$PWD/$0}"
# https://wiki.zshell.dev/community/zsh_plugin_standard#standard-plugins-hash
typeset -gA Plugins
Plugins[Z_A_BIN_GEM_NODE]="${0:h}"
# https://z.digitalclouds.dev/community/zsh_plugin_standard/#funtions-directory
if [[ $PMSPEC != *f* ]]; then
fpath+=( "${0:h}/functions" )
fi
# Autoload functions
autoload -Uz .za-bgn-{bin-or-src-function-{body,body-cygwin},mod-function-body}
autoload -Uz .za-bgn-{{atclone,atload,atdelete,help}-handler,shim-list}
# An empty stub to fill the help handler fields
.za-bgn-null-handler() { :; }
@zi-register-annex "z-a-bin-gem-node" subcommand:shim-list \
.za-bgn-shim-list .za-bgn-help-handler
@zi-register-annex "z-a-bin-gem-node" hook:\!atload-50 \
.za-bgn-atload-handler .za-bgn-null-handler "fbin''|sbin|sbin''|gem''|node''|pip''|fmod''|fsrc''|ferc''"
@zi-register-annex "z-a-bin-gem-node" hook:atclone-50 \
.za-bgn-atclone-handler .za-bgn-null-handler
@zi-register-annex "z-a-bin-gem-node" hook:\%atpull-50 \
.za-bgn-atclone-handler .za-bgn-null-handler
@zi-register-annex "z-a-bin-gem-node" hook:atdelete-50 \
.za-bgn-atdelete-handler .za-bgn-null-handler