fix: trying to fix error in release script

- add quotes to dev_config version member
- add stripping of quotes to customname.py
- removed second for loop from shell script
This commit is contained in:
ZanzyTHEbar 2023-03-21 13:32:18 +00:00
parent aee0719ee5
commit 6e627fb873
3 changed files with 26 additions and 29 deletions

View File

@ -5,7 +5,7 @@
platform = espressif32
framework = arduino
monitor_speed = 115200
custom_firmware_version = 0.0.0
custom_firmware_version="0.0.0"
monitor_rts = 0
monitor_dtr = 0
monitor_filters =
@ -25,7 +25,7 @@ extra_scripts =
pre:tools/customname.py
post:tools/createzip.py
build_flags =
-DVERSION=${this.custom_firmware_version}
'-DVERSION=${this.custom_firmware_version}'
-DENABLE_ADHOC=${wifi.enableadhoc}
-DADHOC_CHANNEL=${wifi.adhocchannel}
-DWIFI_CHANNEL=${wifi.channel}

View File

@ -116,16 +116,25 @@ def customName(project, version, commit, branch):
)
) """
firm_version = env.GetProjectOption("custom_firmware_version")
# strip quotes needed for shell escaping in the firmware version
if firm_version is None:
firm_version = "0.0.0"
else:
firm_version = firm_version.replace('"', "")
firm_version = firm_version.replace("'", "")
env.Replace(
PROGNAME="%s-%s-%s"
% (
str(env["PIOENV"]),
env.GetProjectOption("custom_firmware_version"),
firm_version,
s(defines.get("PIO_SRC_BRH")),
)
)
# detect if there is a forward slash in the PROGNAME and replace it with an underscore
if "/" in env["PROGNAME"]:
env.Replace(PROGNAME="%s" % (env["PROGNAME"].replace("/", "-")))
@ -142,7 +151,7 @@ try:
# Dump global construction environment (for debug purpose)
# write env.Dump() to a file
#with open("env_dump.txt", "w") as f:
# with open("env_dump.txt", "w") as f:
# f.write(env.Dump())
handleGit()

View File

@ -68,38 +68,26 @@ printf "[prepareCMD.sh]: Mass renaming files in the ./build sub folders \n"
#create an array of all the sub folders in the build folder
buildPaths=($(ls ./build))
printf "[prepareCMD.sh]: buildPaths: ${buildPaths[@]} \n"
# loop through all the sub folders in the build folder
for buildPath in "${buildPaths[@]}"
do
printf "[prepareCMD.sh]: Build Path: ${buildPath} \n"
# create a variable to hold the path to the sub folder
buildPath="./build/${buildPath}"
# create a vari able to hold the path to the sub folder's files
# create a variable to hold the path to the sub folder's files
buildPathFiles=($(ls ${buildPath}))
# loop through all the files in the sub folder and rename them to the next release version
for buildPathFile in "${buildPathFiles[@]}"
do
# create a variable to hold the path to the file
buildPathFile="${buildPath}/${buildPathFile}"
# rename the file to the next release version
# parse out the sub folder name and append it to the next release version
# this is to ensure that the file name is unique
#create a variable that holds the current directory
currentDir=$(pwd)
#parse out the parent folder name and store it in a variable
buildPathFileSubFolder=$(basename $(dirname ${buildPathFile}))
# append the sub folder name to the next release version
nextReleaseVersion="${buildPathFileSubFolder}-v${nextReleaseVersion}-master"
mv ${buildPathFile} ${buildPath}/${nextReleaseVersion}.zip
done
#create a variable that holds the current directory
currentDir=$(pwd)
#parse out the parent folder name and store it in a variable
buildPathFileSubFolder=$(basename $(dirname ${buildPathFiles}))
# append the sub folder name to the next release version
nextReleaseVersion="${buildPathFileSubFolder}-v${nextReleaseVersion}-master"
mv ${buildPathFile} ${buildPath}/${nextReleaseVersion}.zip
done
printf "[prepareCMD.sh]: Done \n"