Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Commit

Permalink
Fixes #32 - error prone zsh syntax
Browse files Browse the repository at this point in the history
The old syntax started erroring with zsh 5.4.1.  This new change is confirmed working.  Note that the function used does need to be declared (it seems) before the others.
  • Loading branch information
rosskevin authored Sep 15, 2017
1 parent 3b09bb1 commit 6e2cf95
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ Enabling automatic switching consist in a little shell script for check if `pack
Add the follow snippet in a file loaded by your shell agent, for example, `.extra`.

```bash
cd () { builtin cd "$@" && chpwd; }
pushd () { builtin pushd "$@" && chpwd; }
popd () { builtin popd "$@" && chpwd; }

chpwd () {
function chpwd() {
local PKG
PKG=$PWD/package.json
if [ -f "$PKG" ] && [ "$NODENGINE_LAST_DIR" != "$PWD" ]; then
Expand All @@ -57,6 +53,10 @@ chpwd () {
NODENGINE_LAST_DIR=$PWD
fi
}

function cd() { builtin cd "$@" && chpwd; }
function pushd() { builtin pushd "$@" && chpwd; }
function popd() { builtin popd "$@" && chpwd; }
```

## Fetching new versions
Expand Down

0 comments on commit 6e2cf95

Please sign in to comment.