Skip to content

Commit

Permalink
Updated to nextflow 0.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pditommaso committed Jul 24, 2014
1 parent d351fa9 commit 056ecd1
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions nextflow
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,38 @@
# You should have received a copy of the GNU General Public License
# along with Nextflow. If not, see <http://www.gnu.org/licenses/>.

NORMAL=$(tput sgr0)
GREEN=$(tput setaf 2; tput bold)
YELLOW=$(tput setaf 3)
RED=$(tput setaf 1)

function echo_red() {
echo -e "$RED$*$NORMAL"
}

function echo_green() {
echo -e "$GREEN$*$NORMAL"
}

function echo_yellow() {
echo -e "$YELLOW$*$NORMAL"
}

function get() {
if command -v wget &>/dev/null; then
GET="wget -q $1 -O $2"
elif command -v curl &>/dev/null; then
GET="curl -fsSL $1 -o $2"
else
echo "Error: cannot find 'curl' nor 'wget' utility -- please install one of them"
echo_red "Error: cannot find 'curl' nor 'wget' utility -- please install one of them"
exit 1
fi

printf "Downloading nextflow dependencies. It may require some seconds, please wait .. "
$GET; status=$?
printf "\r\033[K"
if [ $status -ne 0 ]; then
echo "Error: cannot download nextflow required file -- make sure you can connect the internet"
echo_red "Error: cannot download nextflow required file -- make sure you can connect the internet"
echo ""
echo "Alternatively you can download the file:"
echo " $1"
Expand Down Expand Up @@ -74,7 +91,7 @@ if [ "$0" = "bash" ] || [ "$0" = "/bin/bash" ]; then
fi

NXF_HOME=${NXF_HOME:-$HOME/.nextflow}
NXF_VER=${NXF_VER:-'0.8.1'}
NXF_VER=${NXF_VER:-'0.8.4'}

# Check if it is required to run in background
bg=''
Expand Down Expand Up @@ -108,26 +125,27 @@ NXF_BASE=${NXF_BASE:-http://www.nextflow.io/releases}
NXF_PATH=$(dirname $NXF_BIN)
NXF_URL=${NXF_URL:-$NXF_BASE/v$NXF_VER/$NXF_JAR}

# Find out installed JDK
JAVA=java
[[ -n "$JAVA_HOME" ]] && JAVA="$JAVA_HOME/bin/java"

# Verify installed Java version
if [ ! -f "$NXF_BIN" ]; then
# Check Java version
java -version 2>&1 | awk '/version/ {print $3}' | grep '"1\.[7|8]\..*"' > /dev/null
$JAVA -version 2>&1 | awk '/version/ {print $3}' | grep '"1\.[7|8]\..*"' > /dev/null
if [ $? -ne 0 ]; then
echo "Error: cannot find Java or it's a wrong version -- please make sure that Java 7 it's installed"
echo_red "Error: cannot find Java or it's a wrong version -- please make sure that Java 7 or higher it's installed"
[ "$JAVA_HOME" ] && echo_red "Note : nextflow is trying to use the Java VM whose installation path is defined by the variable JAVA_HOME = $JAVA_HOME\n"
exit 1
fi

mkdir -p $NXF_PATH || exit $?
get "$NXF_URL" "$NXF_BIN"
fi

# Find out Java
JAVA=java
[[ -n "$JAVA_HOME" ]] && JAVA="$JAVA_HOME/bin/java"

if [ -z "NXF_OPTIONS" ]; then
NXF_OPTIONS="-Djava.awt.headless=true -Xms512m"
NXF_OPTIONS="-Djava.awt.headless=true"
else
NXF_OPTIONS="-Djava.awt.headless=true -Xms512m $NXF_OPTIONS"
NXF_OPTIONS="-Djava.awt.headless=true $NXF_OPTIONS"
fi

# Set the class-path
Expand Down

0 comments on commit 056ecd1

Please sign in to comment.