-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Patrick Heneise
committed
Feb 26, 2014
1 parent
f240729
commit b9f3552
Showing
5 changed files
with
386 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
fs = require('fs'); | ||
bcnjs2013 = require('./contents/2013'); | ||
bcnjs2014 = require('./contents/2014'); | ||
|
||
desc('Monthly talks'); | ||
task('copy', [], function () { | ||
console.info('Copying for next month'); | ||
var | ||
found = false, | ||
next_event = {}; | ||
|
||
bcnjs2014.forEach(function (event) { | ||
var event_date = new Date(event.date); | ||
if (event_date >= new Date() && !found) { | ||
next_event = event; | ||
found = true; | ||
} | ||
}); | ||
|
||
fs.writeFile('./contents/_index/events.json', next_event.talks, function (err) { | ||
console.info('Done. Next event: ' + new Date(next_event.date).toDateString()); | ||
complete(); | ||
}); | ||
|
||
}, true); | ||
|
||
task('clear', [], function () { | ||
console.info('Cleaning for next month'); | ||
fs.writeFile('./contents/_index/events.json', '[{},{}]', function (err) { | ||
complete(); | ||
}); | ||
}, true); |
Oops, something went wrong.