Skip to content

Commit

Permalink
Until #441 happens, provide a @chdir macro for convenience.
Browse files Browse the repository at this point in the history
Can be used as follows:

    @chdir dir begin
        # do stuff from dir
    end
  • Loading branch information
StefanKarpinski committed May 10, 2012
1 parent 1d8c9cf commit 75c27f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -421,3 +421,5 @@ function chdir(f::Function, dir::String)
throw(err)
end
end

macro chdir(dir,ex); :(chdir(()->$ex,$dir)); end

0 comments on commit 75c27f1

Please sign in to comment.