diff options
author | tv <tv@shackspace.de> | 2014-07-15 12:57:01 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2014-07-15 12:57:01 +0200 |
commit | 5d975cef395e8e52b1abbd5f8a897532c386b9d8 (patch) | |
tree | affcbea7ca04cd3f5e703c3913b4497a7b6faf3b | |
parent | 55ce96f905c2abd96346abc007d87b35a0074656 (diff) |
Reaktor nag: factor out git_pull_output_filter
-rwxr-xr-x | Reaktor/commands/nag | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Reaktor/commands/nag b/Reaktor/commands/nag index 7c4fd3c6..338c083e 100755 --- a/Reaktor/commands/nag +++ b/Reaktor/commands/nag @@ -8,16 +8,22 @@ fi trap 'rm -f nag.hosts.ls nag.services.ls nag.patch' EXIT INT QUIT + +git_pull_output_filter() { + sed -n '/^ [0-9]\+ file change/p' +} + + if ! test -d nag.hosts; then git clone "$hosts_repo" nag.hosts else - (cd nag.hosts && git pull) | sed '/Already up-to-date/d' + (cd nag.hosts && git pull) | git_pull_output_filter fi if ! test -d nag.services; then git clone "$services_repo" nag.services else - (cd nag.services && git pull) | sed '/Already up-to-date/d' + (cd nag.services && git pull) | git_pull_output_filter fi |