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 25, 2015
1 parent 339957d commit 45f5b3d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions scripts/link-non-core-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/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 $(find . -mindepth 1 -maxdepth 1 -type d); do
if [ -L "../${pkg}" ]; then
echo "Package ${pkg} is already linked."
elif [ -e "../${pkg}" ] || [ -d "../${pkg}" ]; then
echo "Package ${pkg} does already exist."
else
ln -s "${pkg}" ..
echo "Package ${pkg} linked."
fi
done

fi

popd >/dev/null 2>&1

0 comments on commit 45f5b3d

Please sign in to comment.