-
Notifications
You must be signed in to change notification settings - Fork 14
/
runLocalRegex101.sh
executable file
·34 lines (26 loc) · 1.02 KB
/
runLocalRegex101.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
#!/bin/bash
trap ctrl_c SIGINT;
tempdir=`mktemp -d`
pushd $tempdir
wget -r --no-host-directories --no-parent https://regex101.com;
wget --output-document ./static/golangWorker.js https://regex101.com/static/golangWorker.js;
wget --output-document ./static/pcreWorker.js https://regex101.com/static/pcreWorker.js;
wget --output-document ./static/javascriptWorker.js https://regex101.com/static/javascriptWorker.js;
wget --output-document ./static/pcrelib.js https://regex101.com/static/pcrelib.js;
wget --output-document ./static/golang.js https://regex101.com/static/golang.js;
wget --output-document ./static/bundle.js https://regex101.com/static/bundle.js;
wget --output-document ./static/vendor.71600b0e.chunk.js https://regex101.com/static/vendor.71600b0e.chunk.js;
wget --output-document ./static/sw.js https://regex101.com/static/sw.js;
function server {
python -m SimpleHTTPServer $@;
}
function cleanup {
echo "Cleaning up downloaded files...";
popd;
rm -rf ${tempdir};
}
function ctrl_c {
cleanup;
exit $?;
}
server $@;