diff options
Diffstat (limited to 'Algorithms/install-algs4.sh')
-rwxr-xr-x | Algorithms/install-algs4.sh | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Algorithms/install-algs4.sh b/Algorithms/install-algs4.sh index e0ba67e..9ec52da 100755 --- a/Algorithms/install-algs4.sh +++ b/Algorithms/install-algs4.sh @@ -1,32 +1,37 @@ #! /bin/bash -DST=$HOME/algs4 +FULLPATH=$(readlink -f $0) +DST=${FULLPATH%/*}/algs4 mkdir -p $DST pushd $DST + mkdir bin -wget http://algs4.cs.princeton.edu/linux/drjava.jar -wget http://algs4.cs.princeton.edu/linux/drjava -chmod 700 drjava -mv drjava bin wget http://algs4.cs.princeton.edu/code/stdlib.jar wget http://algs4.cs.princeton.edu/code/algs4.jar wget http://algs4.cs.princeton.edu/linux/checkstyle.zip wget http://algs4.cs.princeton.edu/linux/findbugs.zip + unzip checkstyle.zip rm checkstyle.zip unzip findbugs.zip rm findbugs.zip + wget http://algs4.cs.princeton.edu/linux/checkstyle.xml wget http://algs4.cs.princeton.edu/linux/findbugs.xml wget http://algs4.cs.princeton.edu/linux/checkstyle wget http://algs4.cs.princeton.edu/linux/findbugs -chmod 700 checkstyle findbugs -mv checkstyle findbugs bin +wget http://algs4.cs.princeton.edu/linux/config.sh + +chmod 700 checkstyle findbugs config.sh +mv checkstyle findbugs config.sh bin mv checkstyle.xml checkstyle-5.5 mv findbugs.xml findbugs-2.0.1 -wget http://algs4.cs.princeton.edu/linux/config.sh -mv config.sh bin + +sed -i "s'INSTALL=.*$'INSTALL=$DST'" $DST/bin/checkstyle +sed -i "s'INSTALL=.*$'INSTALL=$DST'" $DST/bin/findbugs +sed -i "s'\(if \[.*$\)'\1\n\n\tDST=$DST'" $DST/bin/config.sh +sed -i "s'HOME\/algs4'DST'g" $DST/bin/config.sh popd |