Skip to content

Commit

Permalink
Issue #1687. Keeping a reference to __originalDirname in Cake tasks, …
Browse files Browse the repository at this point in the history
…after Node's __dirname
  • Loading branch information
jashkenas committed Sep 12, 2011
1 parent 85342f1 commit c5dbb1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/coffee-script/cake.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/cake.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ helpers.extend global,
missingTask name unless tasks[name]
tasks[name].action options


# Run `cake`. Executes all of the tasks you pass, in order. Note that Node's
# asynchrony may cause tasks to execute in a different order than you'd expect.
# If no tasks are passed, print the help screen.
# If no tasks are passed, print the help screen. Keep a reference to the
# original directory name, when running Cake tasks from subdirectories.
exports.run = ->
process.chdir cakefileDirectory fs.realpathSync '.'
global.__originalDirname = fs.realpathSync '.'
process.chdir cakefileDirectory __originalDirname
args = process.argv.slice 2
CoffeeScript.run fs.readFileSync('Cakefile').toString(), filename: 'Cakefile'
oparse = new optparse.OptionParser switches
Expand Down

1 comment on commit c5dbb1c

@michaelficarra
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope you plan to document that. And commit to that name forever.

Please sign in to comment.