Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 25 lines (23 sloc) 619 Bytes
#!/bin/bash
set -e
EXPECTED_ARGS=1
if [ $# -lt $EXPECTED_ARGS ]
then
echo "Usage: `basename $0` directory"
echo "WILL clobber existing files without permission: Use at your own risk"
exit 65
fi
DEST=$1
FILES=$(git ls-files | grep -v .gitignore | grep -v ^$(basename $0)$)
for f in $FILES ; do
echo $f
if [ -n "$(dirname $f)" -a "$(dirname $f)" != "." -a ! -d "$DEST/$(dirname $f)" ] ; then
mkdir -p $DEST/$(dirname $f)
fi
# system specific files take precidence
if [ -e ".sys/$(hostname)/$f" ] ; then
ln -sf $(pwd)/.sys/$(hostname)/$f $DEST/$f
else
ln -sf $(pwd)/$f $DEST/$f
fi
done