mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Issue #1687. Keeping a reference to __originalDirname in Cake tasks, after Node's __dirname
This commit is contained in:
parent
85342f1e31
commit
c5dbb1c933
2 changed files with 6 additions and 4 deletions
|
@ -31,7 +31,8 @@
|
|||
});
|
||||
exports.run = function() {
|
||||
var arg, args, _i, _len, _ref, _results;
|
||||
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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue