Skip to content

Commit c83e445

Browse files
author
Jonathan Dahan
committed
Do not export fun variable when loading function, fixes #269
1 parent 5267e64 commit c83e445

File tree

7 files changed

+15
-11
lines changed

7 files changed

+15
-11
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
The format is based on [Keep a Changelog](http://keepachangelog.com/)
44
and this project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## 2.0.3 - unreleased
7+
8+
### Fixed
9+
- Accidental export of local fun variable
10+
611
## 2.0.2 - 2019-09-04
712

813
### Fixed

functions/geometry_git.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# geometry_git - please see the readme for documentation on all features
22

3-
(( $+commands[git] )) || return
4-
53
geometry_git_stashes() {
64
git rev-parse --quiet --verify refs/stash >/dev/null \
75
&& ansi ${GEOMETRY_GIT_COLOR_STASHES:="144"} ${GEOMETRY_GIT_SYMBOL_STASHES:=""}
@@ -87,6 +85,8 @@ geometry_git_conflicts() {
8785
}
8886

8987
geometry_git() {
88+
(( $+commands[git] )) || return
89+
9090
command git rev-parse --git-dir > /dev/null 2>&1 || return
9191

9292
$(command git rev-parse --is-bare-repository 2>/dev/null) \

functions/geometry_kube.zsh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# geometry_kube - show kubectl client version and current context/namespace.
22

3-
(( $+commands[kubectl] )) || return
4-
53
geometry_kube() {
4+
(( $+commands[kubectl] )) || return
65
( ${GEOMETRY_KUBE_PIN:=false} ) || [[ -n "$KUBECONFIG" ]] || return
76
: ${GEOMETRY_KUBE_SEPARATOR:="|"}
87

functions/geometry_node.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# geometry_node - show node and npm/yarm version when in a node project context
22

3-
(( $+commands[node] )) || return
4-
53
geometry_node() {
4+
(( $+commands[node] )) || return
5+
66
test -n "$GEOMETRY_NODE_PIN" || test -f package.json || test -f yarn.lock || return 1
77

88
GEOMETRY_NODE=$(ansi ${GEOMETRY_NODE_COLOR:=green} ${GEOMETRY_NODE_SYMBOL=""})

functions/geometry_ruby.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# geometry_ruby - display the current ruby version, rvm version, and gemset
22

3-
(( $+commands[ruby] )) || return
4-
53
geometry_ruby() {
4+
(( $+commands[ruby] )) || return
5+
66
GEOMETRY_RUBY=$(ansi ${GEOMETRY_RUBY_COLOR:=default} ${GEOMETRY_RUBY_SYMBOL:=""})
77

88
[[ $(ruby -v) =~ 'ruby ([0-9a-zA-Z.]+)' ]]

functions/geometry_rustup.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# geometry_rustup - display a symbol colored with the currently selected rustup toolchain
22

3-
(( $+commands[rustup] )) || return
4-
53
geometry_rustup() {
4+
(( $+commands[rustup] )) || return
5+
66
( ${GEOMETRY_RUSTUP_PIN:=false} ) || { cargo locate-project 2>/dev/null || { echo -n '' && return; } }
77

88
: ${GEOMETRY_RUSTUP_STABLE_COLOR:=green}

geometry.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GEOMETRY_ROOT=${0:A:h}
1313

1414
autoload -U add-zsh-hook
1515

16-
for fun in "${GEOMETRY_ROOT}"/functions/geometry_*.zsh; do . $fun; done
16+
function { local fun; for fun ("${GEOMETRY_ROOT}"/functions/geometry_*.zsh(N.)) . $fun }
1717

1818
(( $+functions[ansi] )) || ansi() { (($# - 2)) || echo -n "%F{$1}$2%f"; }
1919

0 commit comments

Comments
 (0)