11#! /usr/bin/bash
22
3+ BINPATH=" node_modules/.bin"
4+ TRUFFLE=" $BINPATH /truffle"
5+ TESTRPC=" $BINPATH /testrpc"
6+
37trap catch INT
48
59function print_style
@@ -20,7 +24,7 @@ function initialize
2024 mkdir -p logs
2125 # starting testrpc
2226 print_style ' info' " Starting testrpc daemon in a tmux session\n"
23- tmux new-session -s testrpc -d script -f logs/testrpc.$date .log -c testrpc || exit 1
27+ tmux new-session -s testrpc -d script -f logs/testrpc.$date .log -c $TESTRPC || exit 1
2428}
2529function finalize
2630{
@@ -42,7 +46,7 @@ function runCompile
4246 # compile contracts
4347 logfile=" logs/compile.$date .log"
4448 printf " Compiling ... "
45- truffle compile > $logfile 2>&1
49+ $TRUFFLE compile > $logfile 2>&1
4650 if [[ $? -ne 0 ]];
4751 then
4852 print_style ' danger' " failure\n"
@@ -59,7 +63,7 @@ function runDeploy
5963 # try deploying contracts
6064 logfile=" logs/deploy.$date .log"
6165 printf " Deploying ... "
62- truffle deploy > $logfile 2>&1
66+ $TRUFFLE deploy > $logfile 2>&1
6367 if [[ $? -ne 0 ]];
6468 then
6569 print_style ' danger' " failure\n"
@@ -82,7 +86,7 @@ function runTests
8286 if [ " $checkpoint " \> " $filename " ]; then continue ; fi
8387
8488 printf " Starting test ${filename% .* } ... "
85- truffle test $filepath > $logfile 2>&1
89+ $TRUFFLE test $filepath > $logfile 2>&1
8690 if [[ $? -ne 0 ]];
8791 then
8892 print_style ' danger' " failure\n"
0 commit comments