aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar √Čtienne Deparis 2020-01-26 16:40:53 +0100
committerGravatar √Čtienne Deparis 2020-01-26 17:11:41 +0100
commit9c8cbea553a81097b0fa2becb81280f507285172 (patch)
tree3a93c57d45a902f83a45f8359aba6f331493e820
parentf934d25b0d3b0a9f837bda0134d718de78492a02 (diff)
downloadneruda-9c8cbea553a81097b0fa2becb81280f507285172.zip
neruda-9c8cbea553a81097b0fa2becb81280f507285172.tar.gz
neruda-9c8cbea553a81097b0fa2becb81280f507285172.tar.xz
Add a new publish command, which just run rake sync:push
-rwxr-xr-xbin/pablo4
-rw-r--r--lib/neruda/utils.rb3
2 files changed, 7 insertions, 0 deletions
diff --git a/bin/pablo b/bin/pablo
index 7bd7d43..aa6a803 100755
--- a/bin/pablo
+++ b/bin/pablo
@@ -50,6 +50,10 @@ module PabloCommands
end
alias_method :pablo_edit, :pablo_open
+ def pablo_publish
+ @rake.invoke_task('sync:push')
+ end
+
def pablo_help(command = 'basic', error = false)
warn R18n.t.pablo.error.no_command if error
cmd = Neruda::Utils.resolve_possible_alias(command)
diff --git a/lib/neruda/utils.rb b/lib/neruda/utils.rb
index d9bffdd..088121f 100644
--- a/lib/neruda/utils.rb
+++ b/lib/neruda/utils.rb
@@ -48,6 +48,9 @@ module Neruda
'open' => { opts: ['-a', '-l', '-t', '-d', '-p', '-v', '-h'],
desc: 'Open or create an org file for edition.' },
'edit' => { alias: 'open' },
+ 'publish' => { opts: ['-h'],
+ desc: 'Push local changes to your public ' \
+ 'server online.' },
'help' => { opts: ['-h'], desc: 'Alias for the -h switch.' },
'basic' => { opts: ['-h', '-V'], label: '<command>' }
}.freeze