forked from espressif/pytest-embedded
-
Notifications
You must be signed in to change notification settings - Fork 0
/
foreach.sh
executable file
·48 lines (42 loc) · 1001 Bytes
/
foreach.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
#!/bin/bash
set -euo pipefail
DEFAULT_PACKAGES=" \
pytest-embedded \
pytest-embedded-serial \
pytest-embedded-serial-esp \
pytest-embedded-idf \
pytest-embedded-jtag \
pytest-embedded-qemu \
pytest-embedded-arduino \
pytest-embedded-wokwi \
"
action=${1:-"install"}
res=0
# one-time command
pip install -U pip
if [ "$action" = "install-editable" ]; then
pip install -U flit
elif [ "$action" = "build" ]; then
pip install -U flit
elif [ "$action" = "publish" ]; then
pip install -U flit
fi
for pkg in $DEFAULT_PACKAGES; do
pushd "$pkg"
if [ "$action" = "install-editable" ]; then
flit install -s
elif [ "$action" = "install" ]; then
pip install .
elif [ "$action" = "uninstall" ]; then
pip uninstall -y $pkg
elif [ "$action" = "build" ]; then
flit build
elif [ "$action" = "publish" ]; then
flit publish
else
echo "invalid argument. valid choices: install-editable/install/uninstall/build/publish"
exit 1
fi
popd
done
exit $res