#!/bin/bash
set -e

SCRIPT_DIR=`dirname $0`

if [[ $TRAVIS_OS_NAME = "linux" ]]
then
    docker pull bioconda/bioconda-builder
else

    # install conda
    curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
    sudo bash Miniconda3-latest-MacOSX-x86_64.sh -b -p /anaconda
    sudo chown -R $USER /anaconda
    mkdir -p /anaconda/conda-bld/osx-64 # workaround for bug in current conda
    mkdir -p /anaconda/conda-bld/linux-64 # workaround for bug in current conda
    export PATH=/anaconda/bin:$PATH
    conda install -y --file $SCRIPT_DIR/requirements.txt
    conda index /anaconda/conda-bld/linux-64 /anaconda/conda-bld/osx-64

    # setup bioconda channel
    conda config --add channels bioconda
    conda config --add channels r
    conda config --add channels file://anaconda/conda-bld
fi

#!/bin/bash
set -e

if [[ $TRAVIS_OS_NAME = "linux" ]]
then
    docker pull bioconda/bioconda-builder
else

    # install conda
    curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
    sudo bash Miniconda3-latest-MacOSX-x86_64.sh -b -p /anaconda
    sudo chown -R $USER /anaconda
    mkdir -p /anaconda/conda-bld/osx-64 # workaround for bug in current conda
    mkdir -p /anaconda/conda-bld/linux-64 # workaround for bug in current conda
    export PATH=/anaconda/bin:$PATH
    conda install -y --file scripts/requirements.txt
    conda index /anaconda/conda-bld/linux-64 /anaconda/conda-bld/osx-64

    # setup bioconda channel
    conda config --add channels bioconda
    conda config --add channels r
    conda config --add channels file://anaconda/conda-bld

    conda install -y toposort
fi

--- 
+++ 
@@ -1,7 +1,5 @@
 #!/bin/bash
 set -e
-
-SCRIPT_DIR=`dirname $0`
 
 if [[ $TRAVIS_OS_NAME = "linux" ]]
 then
@@ -15,11 +13,13 @@
     mkdir -p /anaconda/conda-bld/osx-64 # workaround for bug in current conda
     mkdir -p /anaconda/conda-bld/linux-64 # workaround for bug in current conda
     export PATH=/anaconda/bin:$PATH
-    conda install -y --file $SCRIPT_DIR/requirements.txt
+    conda install -y --file scripts/requirements.txt
     conda index /anaconda/conda-bld/linux-64 /anaconda/conda-bld/osx-64
 
     # setup bioconda channel
     conda config --add channels bioconda
     conda config --add channels r
     conda config --add channels file://anaconda/conda-bld
+
+    conda install -y toposort
 fi
Clean up setup script and make it more portable.
