]> gitweb.fluxo.info Git - puppet-bootstrap.git/commitdiff
Adds syncmodules
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 27 Oct 2017 15:30:28 +0000 (13:30 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 27 Oct 2017 15:30:28 +0000 (13:30 -0200)
bin/syncmodules [new file with mode: 0755]

diff --git a/bin/syncmodules b/bin/syncmodules
new file mode 100755 (executable)
index 0000000..1f5dd07
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+# Setup symlinks.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+MODULES="$1"
+
+# Check parameters
+if [ -z "$MODULES" ]; then
+  echo "Usage: $BASENAME <submodules-folder>"
+  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