summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2016-02-23 09:42:02 +0100
committerazul <azul@riseup.net>2016-02-23 09:42:02 +0100
commite26e2d2c43de0eb0e43193a05b608c34c1ac57a4 (patch)
treed304e5695066b8e9dde689fb99890c6e3309c6ef
parent355244d9a4b74360de67afaa99aba47cf6d9a3b3 (diff)
parent12daa2e01a6e8b019752d67a08462385218c68d3 (diff)
Merge pull request #18 from varac/history_show_only_last_entry
[feat] 'leap history --last' shows only last entry
-rw-r--r--lib/leap_cli/remote/leap_plugin.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/leap_cli/remote/leap_plugin.rb b/lib/leap_cli/remote/leap_plugin.rb
index 50f759e..b48f433 100644
--- a/lib/leap_cli/remote/leap_plugin.rb
+++ b/lib/leap_cli/remote/leap_plugin.rb
@@ -67,8 +67,9 @@ module LeapCli; module Remote; module LeapPlugin
#
# dumps the recent deploy history to the console
#
- def history
- run "(test -s /var/log/leap/deploy-summary.log && tail /var/log/leap/deploy-summary.log) || (test -s /var/log/leap/deploy-summary.log.1 && tail /var/log/leap/deploy-summary.log.1) || (echo 'no history')"
+ def history(lines)
+ command = "(test -s /var/log/leap/deploy-summary.log && tail -n #{lines} /var/log/leap/deploy-summary.log) || (test -s /var/log/leap/deploy-summary.log.1 && tail -n #{lines} /var/log/leap/deploy-summary.log.1) || (echo 'no history')"
+ run command
end
#