Skip to content

Commit

Permalink
Espressif setup.sh corrections, error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
gojimmypi committed Feb 7, 2024
1 parent 2ff9bbc commit 69f3ab5
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions IDE/Espressif/ESP-IDF/setup.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#!/bin/bash

# check if IDF_PATH is set
# check if INSTALL_PATH is set
if [ -z "$IDF_PATH" ]; then
echo "Please follows the instruction of ESP-IDF installation and set IDF_PATH."
echo "Please follows the instruction of ESP-IDF installation and set $IDF_PATH."
exit 1
fi

# check if INSTALL_PATH is set
if [ -z "$INSTALL_PATH" ]; then
echo "INSTALL_PATH not defined."
exit 1
fi



RMDCMD='/bin/rm -rf'
MKDCMD='/bin/mkdir'
CPDCMD='/bin/cp'
Expand All @@ -19,8 +27,8 @@ BASEDIR=`cd ${BASEDIR} && pwd -P`

# echo $WOLFSSL_ESPIDFDIR

WOLFSSLLIB_TRG_DIR=${IDF_PATH}/components/wolfssl
WOLFSSLEXP_TRG_DIR=${IDF_PATH}/examples/protocols
WOLFSSLLIB_TRG_DIR=${INSTALL_PATH}/components/wolfssl
WOLFSSLEXP_TRG_DIR=${INSTALL_PATH}/examples/protocols

if [ "$1" == "--verbose" ]; then
WOLFSSL_SETUP_VERBOSE=true
Expand All @@ -36,15 +44,15 @@ if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
echo ""
fi

if [ ! -d $IDF_PATH ]; then
echo "ESP-IDF Development Framework doesn't exist.: $IDF_PATH"
if [ ! -d $INSTALL_PATH ]; then
echo "ESP-IDF Development Framework doesn't exist.: $INSTALL_PATH"
exit 1
fi

# Copy files into ESP-IDF development framework
pushd $IDF_PATH > /dev/null
pushd $INSTALL_PATH > /dev/null

echo "Copy files into $IDF_PATH"
echo "Copy files into $INSTALL_PATH"

# Remove/Create directories
if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
Expand Down

0 comments on commit 69f3ab5

Please sign in to comment.