Commit 6b44f9ee authored by TomKellyGenetics's avatar TomKellyGenetics
Browse files

handle install to git repo or cellranger_convert

parent a57ac97a
Loading
Loading
Loading
Loading
+25 −12
Original line number Diff line number Diff line
@@ -4,11 +4,25 @@ 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
     prefix=$2
fi

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

if [[ "universc" == $(echo $prefix | rev | cut -d'/' -f1 | rev) ]]
    then
    echo "prefix in existing convert directory"
    prefix=$(echo $prefix | cut -d'/' -f1-$(($( echo $prefix | grep -o "/" | wc -l))))
    echo $prefix
fi

if [[ ! -d $prefix ]]
    then
        echo "--prefix $prefix must be a directory"
@@ -19,7 +33,6 @@ if [[ $1 == "--prefix" ]]
    echo "--prefix $prefix must be a writeable"
    exit 1
fi
fi

if [[ ! -w $prefix ]]
    then
@@ -30,6 +43,8 @@ if [[ ! -w $prefix ]]
    exit 1
fi

echo "installing to: $prefix"

version=$( cat .version )

if [[ -f inst/.installed ]]
@@ -51,8 +66,6 @@ echo $prefix > inst/.installed

echo prefix=$prefix

version=`cat .version`

# create install directory
INSTALLDIR="${prefix}/universc-${version}"
echo "Installing to $INSTALLDIR"