https://github.com/NVIDIA/DIGITS
Raw File
Tip revision: 7d5c1847e6be85239e31a20f0cb5448d7bc9eb42 authored by Luke Yeager on 07 June 2016, 21:01:25 UTC
Mark v4.0.0-rc.1
Tip revision: 7d5c184
digits-server
#!/bin/bash
# Copyright (c) 2014-2016, NVIDIA CORPORATION.  All rights reserved.

set -e

function set_exe {
    # Sets a global variable to the location of an executable
    # Arguments:
    # $1 -- the variable name
    # $2 -- the executable

    # Check to make sure the executable exists
    hash $2 2>/dev/null || { echo >&2 "ERROR: \"$2\" executable not found!"; exit 1; }
    # Print the path to the executable
    local __resultvar=$1
    eval $__resultvar="'$(command -v $2)'"
}

# Some hacking necessary to respect virtualenv installations
set_exe PYTHON_EXE python2
set_exe GUNICORN_EXE gunicorn

$PYTHON_EXE $GUNICORN_EXE \
    --config gunicorn_config.py \
    digits.webapp:app \
    $@
back to top