19 lines
299 B
Bash
19 lines
299 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -e
|
||
|
set -u
|
||
|
|
||
|
export IDF_PATH="$PWD/esp-idf"
|
||
|
export IDF_EXPORT_QUIET=0
|
||
|
source "$IDF_PATH"/export.sh
|
||
|
|
||
|
if [ "$#" -eq 1 ]; then
|
||
|
idf.py erase-flash -p $1
|
||
|
else
|
||
|
if [ "$#" -ne 0 ]; then
|
||
|
echo "Illegal number of parameters"
|
||
|
else
|
||
|
idf.py erase-flash
|
||
|
fi
|
||
|
fi
|