-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgengar
executable file
·48 lines (41 loc) · 1.23 KB
/
gengar
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
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
NODE_VERSION="6.5"
SCRIPT_DIR=$(cd $(dirname $0);pwd)
cd $SCRIPT_DIR
function usage {
cat << _BUFF_
Usage: gengar [options]
-i install
-s run screenshot
-c run compare
_BUFF_
}
while getopts :isc OPTS
do
case ${OPTS} in
i)
echo -n 'BrowserStack Username ?> '
read BROWSER_STACK_USERNAME
echo -n 'BrowserStack Access Key ?> '
read BROWSER_STACK_ACCESS_KEY
BUFF=`cat UItest/bin/config/.setting.js | sed s/{BROWSER_STACK_USERNAME}/$BROWSER_STACK_USERNAME/g | sed s/{BROWSER_STACK_ACCESS_KEY}/$BROWSER_STACK_ACCESS_KEY/g`
echo "$BUFF" > UItest/bin/config/setting.js
docker run -t --rm -v $SCRIPT_DIR/UItest:/usr/src/UItest -w /usr/src/UItest node:$NODE_VERSION npm install
exit 0
;;
s)
docker run -t --rm -v $SCRIPT_DIR/UItest:/usr/src/UItest -w /usr/src/UItest node:$NODE_VERSION npm run screenshot
exit 0
;;
c)
docker run -t --rm -v $SCRIPT_DIR/UItest:/usr/src/UItest -w /usr/src/UItest node:$NODE_VERSION npm run compare
exit 0
;;
*)
usage
exit 1
;;
esac
done
usage
exit 1