Skip to content

Commit

Permalink
Get tmp dir uisng mktemp (#422)
Browse files Browse the repository at this point in the history
- $TMPDIR is not available on all linux

Signed-off-by: NivedhaSenthil<nivedhasenthil@gmail.com>
Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
  • Loading branch information
NivedhaSenthil authored Apr 15, 2020
1 parent a462efe commit 58e7cfd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class_path="$gauge_custom_classpath"
plugin_dir=$(pwd)
project_root="$GAUGE_PROJECT_ROOT"
compile_dir="$gauge_custom_compile_dir"
TMP_DIR="$(dirname $(mktemp -u))/"

JAVA_CMD=java
JAVAC_CMD=javac
Expand Down Expand Up @@ -79,7 +80,7 @@ function list_files() {
function build_project() {
rm -rf $default_build_dir
mkdir -p $default_build_dir
target_file="$TMPDIR$RANDOM-$RANDOM.txt"
target_file="$TMP_DIR$RANDOM-$RANDOM.txt"
echo $(list_files) > $target_file
args="-encoding UTF-8 -d ${default_build_dir} @${target_file}"
if [ ! -z "$(sed '/^$/d' $target_file)" ]; then
Expand Down Expand Up @@ -131,9 +132,10 @@ function start() {
args="${args} -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=${GAUGE_DEBUG_OPTS},timeout=25000"
echo -e "\nRunner Ready for Debugging"
fi
target_file="$TMPDIR$RANDOM-$RANDOM.txt"
target_file="$TMP_DIR$RANDOM-$RANDOM.txt"
echo "-cp \"${class_path}\" ${args} com.thoughtworks.gauge.GaugeRuntime --start" >$target_file
$JAVA_CMD @$target_file
rm $target_file
}

function init() {
Expand Down

0 comments on commit 58e7cfd

Please sign in to comment.