Skip to content

Commit 690ecfc

Browse files
committed
Move IDF definitions to be available with any build
1 parent f7ccc89 commit 690ecfc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tools/config.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ PIO_SDK="FRAMEWORK_SDK_DIR, \"$IDF_TARGET\""
4949
TOOLS_JSON_OUT="$AR_TOOLS/esp32-arduino-libs"
5050
IDF_LIBS_DIR="$AR_ROOT/../esp32-arduino-libs"
5151

52+
if [ -d "$IDF_PATH" ]; then
53+
export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD)
54+
export IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD)
55+
fi
56+
5257
function get_os(){
5358
OSBITS=`arch`
5459
if [[ "$OSTYPE" == "linux"* ]]; then

tools/install-esp-idf.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ fi
3333
if [ ! -x $idf_was_installed ] || [ ! -x $commit_predefined ]; then
3434
git -C $IDF_PATH submodule update --init --recursive
3535
$IDF_PATH/install.sh
36+
export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD)
37+
export IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD)
3638
fi
3739

3840
#
3941
# SETUP ESP-IDF ENV
4042
#
4143

4244
source $IDF_PATH/export.sh
43-
export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD)
44-
export IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD)
4545

4646
#
4747
# SETUP ARDUINO DEPLOY

0 commit comments

Comments
 (0)