forked from cloned-doy/whatsfly
-
Notifications
You must be signed in to change notification settings - Fork 3
/
cli
executable file
·46 lines (45 loc) · 1.49 KB
/
cli
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
#!/usr/bin/env bash
if [ "$1" == "setup" ]; then
set -eux
if ! command -v uv >/dev/null 2>&1; then
pip install uv
fi
if [ ! -d ".venv" ]; then
uv venv
fi
source .venv/bin/activate
uv pip install -r requirements.txt
uv pip install -r dev-requirements.txt
pre-commit install
elif [ "$1" == "compile" ]; then
source .venv/bin/activate
uv pip compile dev-requirements.in requirements.in > dev-requirements.txt
uv pip compile requirements.in > requirements.txt
elif [ "$1" == "sync" ]; then
source .venv/bin/activate
uv pip sync dev-requirements.txt requirements.txt
elif [ "$1" == "test" ]; then
source .venv/bin/activate
python -m pytest $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20}
elif [ "$1" == "build-macos" ]; then
source .venv/bin/activate
pushd whatsfly/dependencies
GOOS=darwin GOARCH=arm64 go build -buildmode=c-shared -o ./whatsmeow/whatsmeow-darwin-arm64.dylib main.go
GOOS=darwin GOARCH=amd64 go build -buildmode=c-shared -o ./whatsmeow/whatsmeow-darwin-amd64.dylib main.go
popd
elif [ "$1" == "test-setup" ]; then
source .venv/bin/activate
rm -rf build dist whatsfly.egg-info
python setup.py check
python setup.py bdist && echo ok
elif [ "$1" == "format" ]; then
source .venv/bin/activate
black .
elif [ "$1" == "lint" ]; then
source .venv/bin/activate
ruff check .
ruff format .
mypy .
else
echo "Unrecognized command: $1"
fi