Skip to content

Commit

Permalink
Fix file-path for dummy FileTask for static files
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Apr 2, 2013
1 parent 522c201 commit 1ef5469
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lib/task/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,21 @@ TaskBase = new (function () {

// Task doesn't exist, may be a static file
if (!prereq) {
filePath = name.split(':')[1] || name;
// May be namespaced
filePath = name.split(':').pop();
filePath = utils.file.absolutize(filePath);
// Create a dummy FileTask if file actually exists
if (existsSync(filePath)) {
stats = fs.statSync(filePath);
prereq = new jake.FileTask(name);
prereq.modTime = stats.mtime;
prereq.dummy = true;
// Put this dummy Task in the global Tasks list so
// modTime will be eval'd correctly
jake.Task[parsed.name] = prereq;
// and there's not already an existing dummy FileTask for it
if (!jake.Task[filePath]) {
stats = fs.statSync(filePath);
prereq = new jake.FileTask(filePath);
prereq.modTime = stats.mtime;
prereq.dummy = true;
// Put this dummy Task in the global Tasks list so
// modTime will be eval'd correctly
jake.Task[filePath] = prereq;
}
}
// Otherwise it's not a valid task
else {
Expand Down

0 comments on commit 1ef5469

Please sign in to comment.