Skip to content

Commit

Permalink
Merge pull request #254 from fgrandel/bugfix/build-script-clean
Browse files Browse the repository at this point in the history
fix: typo in build script clean command
  • Loading branch information
ty4tw authored Dec 26, 2021
2 parents b5f2fd6 + c4e2ac4 commit 4508461
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions MQTTSNGateway/build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/bash

WORK_DIR=$(realpath $(dirname "$0")/..)
BDIR=build.gateway
ODIR=bin/

build () {
echo "Start building MQTT-SN Gateway $1"

cd $SCRIPT_DIR/..
BDIR='build.gateway'
pushd "$WORK_DIR"
if [ ! -d ./$BDIR ]; then
mkdir $BDIR
fi
Expand All @@ -13,12 +16,10 @@ build () {
make MQTTSNPacket
make MQTT-SNGateway
make MQTT-SNLogmonitor
cd ../MQTTSNGateway
cp *.conf ./bin/
popd
cp *.conf ./$ODIR
}

SCRIPT_DIR=$(cd $(dirname $0); pwd)

if [ $1 == "udp" ] ; then
build $1 $2 $3
elif [ $1 == "udp6" ] ; then
Expand All @@ -34,7 +35,10 @@ elif [ $1 == "dtls" ] ; then
elif [ $1 == "dtls6" ] ; then
build dtls "${2} ${3} -DDTLS6"
elif [ $1 == "clean" ] ; then
rm -rf ../builg.gateway
pushd "$WORK_DIR"
rm -rf ./$BDIR
popd
rm -rf ./$ODIR
else
echo "Usage: build.sh [ udp | udp6 | xbee | loralink | rfcomm | dtls | dtls6 | clean]"
fi
Expand Down

0 comments on commit 4508461

Please # to comment.