aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2014-07-15 12:57:01 +0200
committertv <tv@shackspace.de>2014-07-15 12:57:01 +0200
commit431683b901e8e9e6031f414536e399d1ed42e636 (patch)
treeb8bf913487323280e67536fd6f5e554f4e3433db /commands
parent2d4e63ae32586095bd7e56492946f10cb4b8040f (diff)
Reaktor nag: factor out git_pull_output_filter
Diffstat (limited to 'commands')
-rwxr-xr-xcommands/nag10
1 files changed, 8 insertions, 2 deletions
diff --git a/commands/nag b/commands/nag
index 7c4fd3c..338c083 100755
--- a/commands/nag
+++ b/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