Skip to content

Commit

Permalink
Added guide to rebuild script
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmerfield committed Jan 16, 2019
1 parent bc3215b commit c57da27
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/entry/rebuild.js
@@ -1,6 +1,13 @@
var get = require("../get/entry");
var sync = require("../../app/sync");

if (!process.argv[2]) {
console.log(
"Please pass a URL to a blog post 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) {
Expand All @@ -9,6 +16,8 @@ get(process.argv[2], function(err, user, blog, entry) {
if (err) throw err;
done(null, function(err) {
if (err) throw err;
console.log('Rebuilt:', process.argv[2]);
process.exit();
});
});
});
Expand Down

0 comments on commit c57da27

Please sign in to comment.