aboutsummaryrefslogtreecommitdiff
path: root/bin/symlinks
blob: c331261ff981ea244090022223cbcc51fef51968 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 && ln -sf $path )
done