1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#!/bin/sh
#set -x
# find existing web inspector
killprocess(){
echo ps -ef | awk "!/awk/ && /$1/ {print $2}"
#pid=`ps -ef | awk -v keyword=$1 "!/awk/ && /${keyword}/ {print $2}"`;
pid=`ps -ef | awk -v a=node-inspector '!/awk/ && /${a}/ {print $2}'`;
echo current $1 process is $pid;
if [ -n '$pid' ]
then
echo killing $1 process $pid;
#kill $pid;
else
echo $1 is not active;
fi
}
killprocess node-inspector
killprocess mocha
echo launching node-inspector
node-inspector &
echo launching test $1
mocha --debug-brk -R spec $1 &
|