60-rc1.5
This commit is contained in:
+31
-12
@@ -17,6 +17,8 @@ versionData=$installDir/version-data.txt # version data log file
|
|||||||
idfDir=$installDir/esp-idf # esp-idf path
|
idfDir=$installDir/esp-idf # esp-idf path
|
||||||
espressifLocation=$HOME/.espressif # espressif tools install location
|
espressifLocation=$HOME/.espressif # espressif tools install location
|
||||||
customBinLocation=$installDir/.custom_bin # where custom bin scripts are placed
|
customBinLocation=$installDir/.custom_bin # where custom bin scripts are placed
|
||||||
|
exportScript=$idfDir/export.sh # export script
|
||||||
|
exportBackupScript="${exportScript}.bak"
|
||||||
runningDir="$( cd "$( dirname "$0" )" && pwd )"
|
runningDir="$( cd "$( dirname "$0" )" && pwd )"
|
||||||
customBinFrom=$runningDir/custom_bin # dir where custom scripts are coming FROM
|
customBinFrom=$runningDir/custom_bin # dir where custom scripts are coming FROM
|
||||||
helpText=$runningDir/help.txt
|
helpText=$runningDir/help.txt
|
||||||
@@ -88,28 +90,42 @@ function handleCustomBins() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
writeToLog "Handling export.sh (function ran)"
|
writeToLog "Handling $exportScript (function ran)"
|
||||||
|
|
||||||
writeToLog "backing up ${idfDir}/export.sh to ${idfDir}/export.sh.bak"
|
if [ -z $testExport ]; then
|
||||||
cp $idfDir/export.sh $idfDir/export.sh.bak
|
writeToLog "testExport not set"
|
||||||
|
|
||||||
|
writeToLog "backing up $exportScript to $exportBackupScript"
|
||||||
|
cp $exportScript $exportBackupScript
|
||||||
returnStatus
|
returnStatus
|
||||||
|
else
|
||||||
|
writeToLog "testExport enabled"
|
||||||
|
|
||||||
|
writeToLog "deleting $exportScript"
|
||||||
|
rm -f $exportScript
|
||||||
|
returnStatus
|
||||||
|
|
||||||
|
writeToLog "restoring $exportScript from backup at $exportBackupScript"
|
||||||
|
cp $exportBackupScript $exportScript
|
||||||
|
returnStatus
|
||||||
|
fi
|
||||||
|
|
||||||
writeToLog "adding ${runningDir}/add-to-export-sh.txt to ${idfDir}/export.sh"
|
writeToLog "adding ${runningDir}/add-to-export-sh.txt to ${idfDir}/export.sh"
|
||||||
cat $runningDir/add-to-export-sh.txt >> $idfDir/export.sh
|
cat $runningDir/add-to-export-sh.txt >> $idfDir/export.sh
|
||||||
returnStatus
|
returnStatus
|
||||||
|
|
||||||
writeToLog "editing ${idfDir}/export.sh to remove ending \`return 0\`"
|
writeToLog "editing $exportScript to remove ending \`return 0\`"
|
||||||
sed -i 's/return 0/# return 0/g' $idfDir/export.sh
|
sed -i 's/return 0/# return 0/g' $exportScript
|
||||||
returnStatus
|
returnStatus
|
||||||
|
|
||||||
writeToLog "editing $idfDir/export.sh with version information: $versionData"
|
writeToLog "editing $exportScript with version information: $scriptVers"
|
||||||
sed -i "s/versionTAG/\'$versionData\'/g" $idfDir/export.sh
|
sed -i "s/versionTAG/\'$scriptVers\'/g" $exportScript
|
||||||
returnStatus
|
returnStatus
|
||||||
|
|
||||||
dateStampInstall=$(date '+%d-%m-%Y %H:%M:%S %Z (%s)')
|
dateStampInstall=$(date '+%d-%m-%Y %H:%M:%S %Z (%s)')
|
||||||
|
|
||||||
writeToLog "editing $idfDir/export.sh with install date information: $dateStampInstall"
|
writeToLog "editing $exportScript with install date information: $dateStampInstall"
|
||||||
sed -i "s/installDateTAG/\'$dateStampInstall\'/g" $idfDir/export.sh
|
sed -i "s/installDateTAG/\'$dateStampInstall\'/g" $exportScript
|
||||||
returnStatus
|
returnStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +154,7 @@ function handleSetupEnvironment() {
|
|||||||
function handleAliasEnviron() {
|
function handleAliasEnviron() {
|
||||||
if ! [ -z $(alias | grep get_idf) ]; then
|
if ! [ -z $(alias | grep get_idf) ]; then
|
||||||
writeToLog "get_idf alias not found, appending to ${$rcFile}"
|
writeToLog "get_idf alias not found, appending to ${$rcFile}"
|
||||||
echo -e "\nalias get_idf='. ${idfDir}/export.sh'" >> $rcFile
|
echo -e "\nalias get_idf='. ${exportScript}'" >> $rcFile
|
||||||
returnStatus
|
returnStatus
|
||||||
else
|
else
|
||||||
writeToLog "get_idf alias already installed, skipping"
|
writeToLog "get_idf alias already installed, skipping"
|
||||||
@@ -202,8 +218,8 @@ function handleDownloadInstall() {
|
|||||||
commitHash=$(git -C $idfDir rev-parse HEAD)
|
commitHash=$(git -C $idfDir rev-parse HEAD)
|
||||||
returnStatus
|
returnStatus
|
||||||
|
|
||||||
writeToLog "editing $idfDir/export.sh with git commit hash data: $commitHash"
|
writeToLog "editing $exportScript with git commit hash data: $commitHash"
|
||||||
sed -i "s/commitTAG/\'$commitHash\'/g" $idfDir/export.sh
|
sed -i "s/commitTAG/\'$commitHash\'/g" $exportScript
|
||||||
returnStatus
|
returnStatus
|
||||||
|
|
||||||
gitDataLog="installed esp-idf from commit $commitHash from branch $gitBranch using $scriptVers"
|
gitDataLog="installed esp-idf from commit $commitHash from branch $gitBranch using $scriptVers"
|
||||||
@@ -320,10 +336,13 @@ elif [ "$arg" == "test" -o "$arg" == "t" ]; then # minimal actions taken, echo t
|
|||||||
|
|
||||||
sleepMins=0
|
sleepMins=0
|
||||||
|
|
||||||
|
testExport=1
|
||||||
|
|
||||||
handleStart
|
handleStart
|
||||||
handleCustomBins
|
handleCustomBins
|
||||||
handleDownloadInstall
|
handleDownloadInstall
|
||||||
handleExport
|
handleExport
|
||||||
|
handleTestExport
|
||||||
handleAliasEnviron
|
handleAliasEnviron
|
||||||
handleEnd
|
handleEnd
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
60-rc1.4
|
60-rc1.5
|
||||||
Reference in New Issue
Block a user