~gary/juju-gui/bug1218924

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

set -m

fn=`tempfile`
(node ./test-server.js $1 | tee $fn )  &
sleep 2
if [ -n "$2" ]; then
    xdg-open `cat $fn`
    fg %1
else
    mocha-phantomjs -t 40000 `cat $fn`
    status=$?
    kill %1
    exit $status
fi

rm $fn