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
1 parent
e91b6f4
commit 0f77ea2
Showing
1 changed file
with
33 additions
and
0 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,33 @@ | ||
var get = require("../get/entry"); | ||
var sync = require("../../app/sync"); | ||
var Entry = require("../../app/models/entry"); | ||
|
||
if (!process.argv[2]) { | ||
console.log( | ||
"Please pass a URL to a blog post or source file as the first and only argument to this script. Blot will rebuild the entry which exists at that URL." | ||
); | ||
process.exit(); | ||
} | ||
|
||
get(process.argv[2], function(err, user, blog, entry) { | ||
if (err) throw err; | ||
sync(blog.id, function(err, folder, done) { | ||
if (err) throw err; | ||
|
||
console.log( | ||
"Changing entry dateStamp from", | ||
entry.dateStamp, | ||
"to", | ||
entry.created | ||
); | ||
|
||
Entry.set(blog.id, entry.path, { dateStamp: entry.created }, function(err) { | ||
if (err) throw err; | ||
done(null, function(err) { | ||
if (err) throw err; | ||
console.log("Rebuilt:", process.argv[2]); | ||
process.exit(); | ||
}); | ||
}); | ||
}); | ||
}); |