Skip to content

Commit

Permalink
Added helper script to link yet not linked non-core packages
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFreudenberg committed Mar 26, 2015
1 parent 7b0d52a commit 3e607d5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/link-non-core-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -e
set -u

# save current path and switch inside packages
pushd "$(dirname $0)/../packages" >/dev/null 2>&1

# test that there are some non-core packages
if [ -d "non-core" ]; then

# change to non-core
cd non-core

# link all ./packages/non-core/pkg to ./packages/pkg
for pkg in $(ls -d *); do
if [ -L "../${pkg}" ]; then
echo "Package ${pkg} is already linked."
elif [ -e "../${pkg}" ] || [ -d "../${pkg}" ]; then
echo "Package ${pkg} does already exist."
elif [ -L "${pkg}" ] || [ -d "${pkg}" ]; then
# link only if folder oder sym-link detected
ln -s "non-core/${pkg}" "../${pkg}"
echo "Package ${pkg} linked."
fi
done

fi

0 comments on commit 3e607d5

Please sign in to comment.