-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbootstrap.sh
executable file
·72 lines (61 loc) · 1.24 KB
/
bootstrap.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
68
69
70
71
72
#!/bin/bash
cd "$(dirname "$0")" || exit 1
all_clear() {
echo ".pytest_cache"
find . -type d -name ".pytest_cache" -exec rm -rf {} \; 2>/dev/null
echo "__pycache__"
find . -type d -name "__pycache__" -exec rm -rf {} \; 2>/dev/null
echo ".cache"
rm -rf alist_sync/.alist-sync-cache alist_sync.egg-info
echo "alist-test-dir"
rm -rf alist/test_* alist/data alist/daemon
}
case $1 in
install)
pip install -U pip
pip install -U git+https://github.com/lee-cq/alist-sdk --no-cache-dir --force-reinstall
pip install -e .
;;
alist)
cd alist || {
echo "Error: tests/alist not find "
exit 1
}
shift
./alist "$@"
;;
alist-init)
pkill alist
rm -rf alist/*
bash tools/init_alist.sh .
;;
clear)
all_clear
;;
clear-log )
rm -rf logs/*
rm -rf alist/data/log/*
./bootstrap.sh alist restart
;;
test)
whereis pytest || pip install pytest
clear
./alist/alist stop || pkill alist
all_clear
shift 1
pytest -v "$@"
;;
main )
shift
python -m alist_sync "$@"
;;
debugger)
all_clear
clear
python3 tests/debugger.py
;;
*)
echo "Usage: $0 {install|alist-init|clear|debugger|test}"
exit 1
;;
esac