improve build script
This commit is contained in:
parent
49afd6d818
commit
7887f67442
30
build.sh
30
build.sh
@ -1,13 +1,35 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "$1" != "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
|
echo "Give one of the targets: build, clean, upload"
|
||||||
|
echo "If you want to use a project directory different"
|
||||||
|
echo "than the current directory, give it as a second"
|
||||||
|
echo "argument."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$2" != "" ]; then
|
||||||
PROJECT_DIR=$1
|
PROJECT_DIR=$1
|
||||||
else
|
else
|
||||||
PROJECT_DIR=$PWD
|
PROJECT_DIR=$PWD
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pushd $PROJECT_DIR/libraries/esp8266boilerplate/ConfigGenerator && ./configGen.sh && popd
|
|
||||||
env ARDUINO_SKETCHBOOK_DIR=$PROJECT_DIR arduino-cli compile --fqbn=esp8266:esp8266:nodemcu $PROJECT_DIR/sketch
|
if [ "$1" == "build" ]; then
|
||||||
cp sketch/sketch.esp8266.esp8266.nodemcu.* .
|
pushd $PROJECT_DIR/libraries/esp8266boilerplate/ConfigGenerator && ./configGen.sh && popd
|
||||||
|
env ARDUINO_SKETCHBOOK_DIR=$PROJECT_DIR arduino-cli compile --fqbn=esp8266:esp8266:nodemcu $PROJECT_DIR/sketch
|
||||||
|
cp sketch/sketch.esp8266.esp8266.nodemcu.* .
|
||||||
|
elif [ "$1" == "clean" ]; then
|
||||||
|
for D in libraries/includes/configuration.h libraries/includes/configuration.cpp sketch/sketch.esp8266.esp8266.nodemcu.bin sketch/sketch.esp8266.esp8266.nodemcu.elf sketch.esp8266.esp8266.nodemcu.bin sketch.esp8266.esp8266.nodemcu.elf; do
|
||||||
|
echo -n "About to delete $D ... "
|
||||||
|
rm $PROJECT_DIR/$D && echo "done"
|
||||||
|
done
|
||||||
|
elif [ "$1" == "upload" ]; then
|
||||||
|
echo "About to upload to device"
|
||||||
|
else
|
||||||
|
echo "Unknown subcommand '$1'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user