Skip to content

Commit 0cee90d

Browse files
committed
allow clean for only one configuration (parameter -config)
1 parent 7b1020c commit 0cee90d

1 file changed

Lines changed: 27 additions & 7 deletions

File tree

clean-package.sh

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,31 @@ if [[ "$#" -eq 0 ]]; then
1010
echo "Package parameter is missing"
1111
fi
1212

13-
for i in $(ls config/distro); do
14-
# source config
15-
. config/distro/$i
16-
17-
(cd $DISTRO
18-
PROJECT=$PROJECT ARCH=$ARCH DEVICE=$DEVICE scripts/clean $1 || true
19-
)
13+
while [[ "$#" -gt 0 ]]; do
14+
case $1 in
15+
-config) shift; CONFIG=$1 ;;
16+
*) PACKAGE=$1;;
17+
esac
18+
shift || continue
2019
done
20+
21+
if [ -n "$CONFIG" ]; then
22+
# only clean one config
23+
. config/distro/$CONFIG
24+
25+
(cd $DISTRO
26+
PROJECT=$PROJECT ARCH=$ARCH DEVICE=$DEVICE scripts/clean $PACKAGE || true
27+
)
28+
29+
else
30+
# clean all
31+
for i in $(ls config/distro); do
32+
echo "DISTRO: $i"
33+
# source config
34+
. config/distro/$i
35+
36+
(cd $DISTRO
37+
PROJECT=$PROJECT ARCH=$ARCH DEVICE=$DEVICE scripts/clean $PACKAGE || true
38+
)
39+
done
40+
fi

0 commit comments

Comments
 (0)