-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·49 lines (36 loc) · 996 Bytes
/
run.sh
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
#!/bin/bash
#
# Usage:
# ./run.sh <function name>
set -o nounset
set -o pipefail
set -o errexit
status() {
git status -s
}
uncommitted() {
status | awk '$1 == "??" { print $2 }'
}
remove-uncommitted() {
uncommitted | xargs --no-run-if-empty -- rm -r -f --verbose
}
save-benchmarks() {
local dest=$1 # e.g. saved/2017-12-20
# no need to save oheap right now since everything is the same size.
# TODO: links to ../../web/benchmarks.css and ../../web/table are broken.
# Could just massage with sed -i '' *.html
for dir in ../oil/_tmp/{osh-parser,osh-runtime,vm-baseline}; do
cp -r $dir $dest
done
# This data doesn't belong
rm -r -f -v $dest/*/raw
}
copy-web-and-sed() {
local dest=$1 # e.g. saved/2017-12-20
# We only want benchmarks.css and web/table
mkdir -p $dest/web/table
cp -v ../oil/web/benchmarks.css $dest/web
cp -v ../oil/web/table/*.{css,js} $dest/web/table
find $dest -name '*.html' | xargs sed -i 's|../../web/|../web/|g'
}
"$@"