From 779e5bd9113a76dd5bb77518c36388e96b7ff7bc Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 27 Oct 2017 13:30:28 -0200 Subject: Adds syncmodules --- bin/syncmodules | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 bin/syncmodules diff --git a/bin/syncmodules b/bin/syncmodules new file mode 100755 index 0000000..1f5dd07 --- /dev/null +++ b/bin/syncmodules @@ -0,0 +1,30 @@ +#!/bin/bash +# +# Setup symlinks. +# + +# Parameters +BASENAME="`basename $0`" +MODULES="$1" + +# Check parameters +if [ -z "$MODULES" ]; then + echo "Usage: $BASENAME " + exit 1 +elif [ ! -e "$MODULES" ]; then + echo "Not found: $MODULES" +fi + +# Add module symlinks using absolute folders +for module in `ls $MODULES`; do + if [ "$module" == "bootstrap" ]; then + continue + fi + + if echo "$module" | grep -q "^site_"; then + continue + fi + + path="`cd $MODULES/$module && pwd`" + ( cd modules &> /dev/null && rsync -av --delete $path/ $module/ ) +done -- cgit v1.2.3