From 13cc81984455218ae1e664af76eafac1e9036b6d Mon Sep 17 00:00:00 2001 From: Jeff Wang Date: Mon, 5 Feb 2018 13:49:36 -0800 Subject: [PATCH] Fix python path typo in the start dev server script (#253) * Fix python path typo in the start dev server script Kill webpack in case of python error. * Switch to use trap * capture more signal. --- scripts/setup_dev_env.sh | 2 +- scripts/start_dev_server.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/setup_dev_env.sh b/scripts/setup_dev_env.sh index 3e2e2cfd3..4d59bf4c1 100755 --- a/scripts/setup_dev_env.sh +++ b/scripts/setup_dev_env.sh @@ -21,4 +21,4 @@ cd build cmake .. make -j $processors -export PYTHON_PATH=$PYTHON_PATH:"$SCRIPT_DIR/.." +export PYTHONPATH=$PYTHONPATH:"$SCRIPT_DIR/.." diff --git a/scripts/start_dev_server.sh b/scripts/start_dev_server.sh index 1a5dcb119..a0951cc47 100755 --- a/scripts/start_dev_server.sh +++ b/scripts/start_dev_server.sh @@ -6,9 +6,19 @@ CURRENT_DIR=`pwd` SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $SCRIPT_DIR/../frontend +export PYTHONPATH=$PYTHONPATH:"$SCRIPT_DIR/.." + ./node_modules/.bin/webpack --watch --config tool/webpack.dev.config.js --output-path=../visualdl/server/dist & +# Track webpack pid +WEBPACKPID=$! + +function finish { + kill -9 $WEBPACKPID +} -export PYTHON_PATH=$PYTHON_PATH:"$SCRIPT_DIR/.." +trap finish EXIT HUP INT QUIT PIPE TERM cd $CURRENT_DIR + +#Run the visualDL with local PATH python ${SCRIPT_DIR}/../visualdl/server/visualDL "$@"