aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2022-12-09 14:43:41 +0100
committerRuben Beltran del Rio <ruben@unlimited.pizza>2022-12-09 14:43:41 +0100
commitc5cbbd3835ccd509179504cdf7d5e74356d7dca5 (patch)
treef5588fce8924772a54f599c5636640731bab640d /bin
parent24de2f063e5dfcad0086d1dc81de3cf012a00e4c (diff)
Add rudimentary sync support
Diffstat (limited to 'bin')
-rwxr-xr-xbin/blog.js36
1 files changed, 35 insertions, 1 deletions
diff --git a/bin/blog.js b/bin/blog.js
index 8f0ab70..dc256ee 100755
--- a/bin/blog.js
+++ b/bin/blog.js
@@ -8,7 +8,17 @@ const Minimist = require('minimist');
const internals = {
blog: new Blog(Config),
- expectedKeys: ['add', 'generate', 'update', 'publish', 'publish-archive', 'version'],
+ expectedKeys: [
+ 'add',
+ 'generate',
+ 'update',
+ 'publish',
+ 'publish-archive',
+ 'add-remote',
+ 'remove-remote',
+ 'sync-up',
+ 'sync-down',
+ 'version'],
// Application entry point. Reads arguments and calls the
// corresponding method from the blog lib
@@ -52,6 +62,26 @@ const internals = {
await internals.blog.publishArchive(value);
return;
}
+
+ if (argument === 'add-remote') {
+ await internals.blog.addRemote(value);
+ return;
+ }
+
+ if (argument === 'remove-remote') {
+ await internals.blog.removeRemote();
+ return;
+ }
+
+ if (argument === 'sync-up') {
+ await internals.blog.syncUp();
+ return;
+ }
+
+ if (argument === 'sync-down') {
+ await internals.blog.syncDown();
+ return;
+ }
}
}
@@ -96,6 +126,10 @@ const internals = {
console.error('blog --generate \t\t\t(generates the blog assets)');
console.error('blog --publish <bucket> \t\t(publishes the blog to an S3 bucket)');
console.error('blog --publish-archive <destination> \t(publishes the archive to a remote host)');
+ console.error('blog --add-remote <git_url> \t\t(adds or updates a git remote to sync with)');
+ console.error('blog --remove-remote \t\t\t(removes the git remote)');
+ console.error('blog --sync-up \t\t\t\t(pushes to the git remote if configured)');
+ console.error('blog --sync-down \t\t\t(pulls from the git remote if configured)');
console.error('blog --version \t\t\t\t(print the version)');
}
};