#!/bin/sh
#copied from nbexec
resolve_symlink () {
    file="$1"
    while [ -h "$file" ]; do
        ls=`ls -ld "$file"`
        link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
        if expr "$link" : '^/' 2> /dev/null >/dev/null; then
            file="$link"
        else
            file=`dirname "$1"`"/$link"
        fi
    done
    echo "$file"
}

absolutize_path () {
    oldpwd=`pwd`
    cd "$1"
    abspath=`pwd`
    cd "${oldpwd}"
    echo "$abspath"
}
PRG="`resolve_symlink "$0"`"
parentDir="`dirname "$PRG"`"
parentDir="`absolutize_path "$parentDir"`"
#resolve the script path
scriptPath="$parentDir/../Resources/praxislive/bin"
#run the main executable
sh -- "$scriptPath/praxislive" "$@"
