From 699b645e55e14d44193250bcaeb603324a689d1c Mon Sep 17 00:00:00 2001 From: Jamie Connolly Date: Tue, 28 Aug 2018 11:28:44 +0100 Subject: [PATCH] :sparkles: Add a sync script --- libexec/handles-sync | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 libexec/handles-sync diff --git a/libexec/handles-sync b/libexec/handles-sync new file mode 100755 index 0000000..1e6bc92 --- /dev/null +++ b/libexec/handles-sync @@ -0,0 +1,16 @@ +#!/bin/bash +# Usage: handles-sync [] +# Summary: Fetch from upstream and update local branches for downloaded projects + +set -e + +TARGET_DIR="${1-${PROJECT_HOME}}" + +shopt -s nullglob +for path in "$TARGET_DIR"/**/*/.git; do + path="${path%/*}" + echo "==> Syncing ${path#${PROJECT_HOME}/}…" + cd "$path" + hub sync || true +done +shopt -u nullglob