arturadib/shelljs — pull request #65 by matthewwithanm (2013-05-25 23:02:15+00:00)
Title: Add cd Context Function Arg

Normally `cd` changes to the specified directory for the duration of the script. These commits allow you to change directories just for a little bit (then change back) without needing the boilerplate of saving the current directory and changing back. This example shows the idea:

```coffeescript
require 'shelljs/global'

pwd() # > '/a'
cd 'b', ->
pwd() # > '/a/b'
pwd() # > '/a'
```

I added some tests to show that it behaves as expected and nests correctly.