aboutsummaryrefslogtreecommitdiff
path: root/puppet/bin/copymodules
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-10-01 15:02:47 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-10-01 15:02:47 -0300
commit765ca2bd25384c3d33d243a5b2f0aa419edcd8fa (patch)
treeb59aa15319607ea45ba83516628539b420d8841b /puppet/bin/copymodules
parentb0d7b1d90860f858578455c5cf695c062c0ade07 (diff)
parentc212514035cffd38acbfac1413064937b28685b6 (diff)
downloadsemanticscuttle-765ca2bd25384c3d33d243a5b2f0aa419edcd8fa.tar.gz
semanticscuttle-765ca2bd25384c3d33d243a5b2f0aa419edcd8fa.tar.bz2
Merge commit 'c212514035cffd38acbfac1413064937b28685b6' as 'puppet'
Diffstat (limited to 'puppet/bin/copymodules')
-rwxr-xr-xpuppet/bin/copymodules37
1 files changed, 37 insertions, 0 deletions
diff --git a/puppet/bin/copymodules b/puppet/bin/copymodules
new file mode 100755
index 0000000..ab5b405
--- /dev/null
+++ b/puppet/bin/copymodules
@@ -0,0 +1,37 @@
+#!/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
+
+# Set puppet folder
+if [ -d "puppet" ]; then
+ PUPPET_FOLDER="puppet"
+else
+ PUPPET_FOLDER="."
+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 $PUPPET_FOLDER/modules &> /dev/null && cp -r $path . )
+done