Skip to content

Commit ce83307

Browse files
committed
[#38] modify scripts for clean storage partition when burn the flash
1 parent e0317d3 commit ce83307

3 files changed

Lines changed: 28 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,35 @@ macro(Get_DIRTYFLAG APP_DIRTYFLAG)
3434
endif()
3535
endmacro()
3636

37+
macro(Get_DIRPART APP_PARTCHECK)
38+
find_package(Git QUIET)
39+
if(GIT_FOUND)
40+
execute_process(
41+
COMMAND ./checkpart.sh
42+
OUTPUT_VARIABLE ${APP_PARTCHECK}
43+
OUTPUT_STRIP_TRAILING_WHITESPACE
44+
ERROR_QUIET
45+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
46+
)
47+
endif()
48+
endmacro()
49+
3750
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
3851

3952
set(APP_COMMITID "")
4053
Get_CommitID(APP_COMMITID)
4154

55+
set(APP_PARTCHECK "")
56+
Get_DIRPART(APP_PARTCHECK)
57+
4258
add_definitions(-DAPP_VERSION=\"${APP_VER_MAJOR}.${APP_VER_MINOR}.${APP_COMMITID}\")
4359
60+
project(SnapAirUnit)
61+
4462
set(APP_DIRTYFLAG "")
4563
Get_DIRTYFLAG(APP_DIRTYFLAG)
4664
47-
project(SnapAirUnit)
65+
message( STATUS "Code: ${APP_DIRTYFLAG}" )
4866
4967
5068

checkpart.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# for partitions dir
4+
mkdir -p ./build/storage
5+
mkdir -p ./build/nvs
6+
mkdir -p ./build/phy_init
7+
8+
9+

checkver.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#!/bin/bash
22

3-
# for partitions dir
4-
mkdir -p ./build/storage
5-
mkdir -p ./build/nvs
6-
mkdir -p ./build/phy_init
7-
83
# for git repo dirty control
94
rm -f version.h
105
if [[ $(git diff --stat) != '' ]]; then

0 commit comments

Comments
 (0)