39 lines
727 B
Bash
Executable File
39 lines
727 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ ${0:0:1} == "/" ]
|
|
then
|
|
SOURCE=$(dirname $0)/
|
|
else
|
|
SOURCE=$(dirname `pwd`/$0)/
|
|
fi
|
|
DESTINATION=~
|
|
|
|
cd $SOURCE
|
|
git submodule init
|
|
git submodule update
|
|
|
|
#BIN="cp -r"
|
|
BIN="ln -s"
|
|
|
|
TMPERR=`mktemp`
|
|
for f in `ls -a $SOURCE`
|
|
do
|
|
if [ "$f" != "." ] && [ "$f" != ".." ] &&
|
|
[ "$f" != ".gitmodules" ] && [ "$f" != "install.sh" ]
|
|
then
|
|
echo -ne "Installing $f ...\t"
|
|
if [ ${#f} -lt 9 ]; then echo -en "\t"; fi
|
|
if [ -L $DESTINATION/$f ]
|
|
then
|
|
echo -e "Already installed"
|
|
elif [ -e $DESTINATION/$f ]
|
|
then
|
|
echo -e "Already existing $f"
|
|
else
|
|
$BIN $SOURCE/$f $DESTINATION/$f >&2 2> $TMPERR
|
|
if [ $? == 0 ]; then echo -e "done"; else echo -e "fail"; fi
|
|
cat $TMPERR
|
|
fi
|
|
fi
|
|
done
|