Commit 307a66f5 authored by TomKellyGenetics's avatar TomKellyGenetics
Browse files

update script

parent 90c06b48
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -26,9 +26,8 @@ else
        current_version=$(cat ${prefix}/.version)
    elif [[ $prefix == *"universc-"* ]]
       then

       prefix=$(echo $prefix | cut -d'/' -f1-$(($( echo $prefix | grep -o "/" | wc -l))))
       prefix=$( ls -d ${prefix}/universc/ | head -n 1 )
       prefix=$( ls -d ${prefix}/universc-*/ | head -n 1 )
    else
       prefix=$( ls -d ${prefix}/universc-*/ | head -n 1)
    fi
+22 −10
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ SHELL=`readlink -f /proc/$$/exe | cut -d/ -f3`

#default install location (root)
if [[ -z $prefix ]]; then prefix="/usr/local/share"; fi
echo "installing to: $prefix"

if [[ $1 == "--prefix" ]]
     then
@@ -12,15 +11,25 @@ if [[ $1 == "--prefix" ]]
     if [[ ! -d $prefix ]]
        then
        echo "--prefix $prefix must be a directory"
         exit 1
    fi
    if [[ ! -w $prefix ]]
        then
        echo "--prefix $prefix must be a writeable"
        exit 1
    fi
fi

if [[ $prefix=="." ]]
    then
    prefix=`pwd`
fi

if [[ "universc" == $(echo $prefix | rev | cut -d'/' -f1 | rev) ]]
    then
    echo "installing to universc"
    prefix=$(echo $prefix | cut -d'/' -f1-$(($( echo $prefix | grep -o "/" | wc -l))))
    INSTALLDIR=${prefix}/universc
fi

if [[ ! -w $prefix ]]
    then
    echo "$prefix must be a writeable directory"
@@ -30,6 +39,8 @@ if [[ ! -w $prefix ]]
    exit 1
fi

echo "installing to: $prefix"

version=$( cat .version )

if [[ -f inst/.installed ]]
@@ -51,10 +62,11 @@ echo $prefix > inst/.installed

echo prefix=$prefix

version=`cat .version`

# create install directory
if [[ -z $INSTALLDIR ]]
    then
    INSTALLDIR="${prefix}/universc-${version}"
fi
echo "Installing to $INSTALLDIR"
mkdir -p ${prefix}/universc-${version}

@@ -68,7 +80,7 @@ if [[ -w ${INSTALLDIR} ]]
    #echo "${INSTALLDIR} added to PATH"
    for SHELL_RC in `ls ~/.*rc`
        do
        echo "export PATH=:${INSTALLDIR}:\$PATH" >> $SHELL_RC
        echo "export PATH=${INSTALLDIR}:\$PATH" >> $SHELL_RC
        echo "universc-${version} added to PATH automatically in new ${SHELL} shell session"
    done
    echo "run the following to add it to your shell of choice"