-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathwat
executable file
·97 lines (88 loc) · 2.72 KB
/
wat
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
# Foreground terminal colors
cfblack="\033[30m";
cfred="\033[31m";
cfgreen="\033[32m";
cfyellow="\033[33m";
cfblue="\033[34m";
cfmagenta="\033[35m";
cfcyan="\033[36m";
cfwhite="\033[37m";
# Background terminal colors
cbblack="\033[40m";
cbred="\033[41m";
cbgreen="\033[42m";
cbyellow="\033[43m";
cbblue="\033[44m";
cbmagenta="\033[45m";
cbcyan="\033[46m";
cbwhite="\033[47m";
# Text attributes
tnorm="\033[0m";
tbold="\033[1m";
tunder="\033[4";
tblink="\033[5m";
treverse="\033[7m";
# Reset
creset="\033[0m";
declare -a args
args=(${*// / })
cmd=$1;
if [ $# -lt 1 ]
then
echo
echo -e "${tbold}${cfwhite}Usage:${cfblue} $0 ${cfyellow}<command>${creset}"
echo
echo -e "\t${tbold}${cfgreen}where ${cfyellow}<command> ${cfwhite}is :-${creset}"
echo
echo -e "\t${tbold}${cfyellow}- bootstrap${cfgreen}:${creset} - Installs dependencies ${cfwhite}[${cfcyan}nodeunit${cfwhite},${cfcyan}byline${cfwhite},${cfcyan}docco${cfwhite}]${creset} via ${cfcyan}npm."
echo -e "\t${tbold}${cfyellow}- test${cfgreen}:${creset} - Runs ${cfcyan}nodeunit${creset} tests."
echo -e "\t${tbold}${cfyellow}- docco${cfgreen}:${creset} - Runs ${cfcyan}docco${creset} to generate docs."
echo -e "\t${tbold}${cfyellow}- microbench${cfgreen}:${creset} - Runs a micro benchmark."
echo -e "\t${tbold}${cfyellow}- samples${cfgreen}:${creset} - Runs samples."
echo -e "\t${tbold}${cfyellow}- travis${cfgreen}:${creset} - Run travis entrypoint"
echo
echo -e "\t${cfred}${cwhite}No args and you get this help. :)${creset}"
echo
exit
fi
echo -e "${tbold}${cfblue}Wat? ${cfyellow}$1${creset}"
case $cmd in
bootstrap )
sudo easy_install pygments
npm install nodeunit docco byline
;;
test )
if [ $# -gt 1 ]
then
NODE_PATH=lib node_modules/nodeunit/bin/nodeunit ${args[@]:1}
else
NODE_PATH=lib node_modules/nodeunit/bin/nodeunit test;
fi
;;
docco )
node_modules/docco/bin/docco `find lib -name \*.js`
;;
microbench )
NODE_PATH=lib node samples/microbench-nontemporal.js
;;
samples )
if [ $# -gt 1 ]
then
NODE_PATH=lib node "${args[@]:1:$#-1}"
else
echo
echo -e "\t${tbold}${cfyellow}Usage:${cfblue} ./wat ${creset}${tbold} samples ${cfyellow}<sample>"
echo
echo -e "\twhere <sample> is:${creset}"
echo -e "\t\t${cfcyan}samples/analytics.js${creset} - Runs the eep.js statistics package sample"
echo -e "\t\t${cfcyan}samples/composite.js${creset} - Runs the eep.js composite function sample"
echo -e "\t\t${cfcyan}samples/custom.js${creset} - Runs Tim Bray's Wide Finder inspired custom aggregate function sample"
echo -e "${creset}"
fi
;;
travis )
npm i
NODE_PATH=lib node_modules/nodeunit/bin/nodeunit test
;;
esac