-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
67 lines (54 loc) · 1.14 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
set -e
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
function install {
set -x
python -m pip install --upgrade pip
}
function get-localhost {
# Detect the OS
OS=$(uname -s)
if [ "$OS" = "Darwin" ]; then
# if macOS, use host.docker.internal
export LOCALHOST=host.docker.internal
else
# otherwise use localhost
export LOCALHOST=localhost
fi
}
function clean {
rm -rf \
dist \
out \
build \
coverage.xml \
test-reports \
tests/artifacts \
.vscode-test \
coverage \
.nyc_output \
.coverage
find . \
-type d \
\( \
-name "*cache*" \
-o -name "*.dist-info" \
-o -name "*.egg-info" \
-o -name "*htmlcov" \
\) \
-not -path "*env/*" \
-exec rm -r {} + || true
find . \
-type f \
-name "*.pyc" \
-o -name "*.vsix" \
-not -path "*env/*" \
-exec rm {} +
}
function help {
echo "$0 <task> <args>"
echo "Tasks:"
compgen -A function | cat -n
}
TIMEFORMAT="Task completed in %3lR"
time ${@:-help}