Skip to content

Commit 98c92ea

Browse files
committed
Fixed replace to scan cpphash
1 parent 01c08ce commit 98c92ea

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Bashrc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ ! -f $CH_HOME/make/cpphash.mk ]; then
1818
fi
1919

2020
if [[ "$CH_BUILD" == "" ]]; then
21-
CH_BUILD="build"
21+
export CH_BUILD="build"
2222
fi
2323

2424
if [[ "$ESPMAKE_PREFIX" == "" ]]; then
@@ -84,7 +84,7 @@ fi
8484
# of the last project built. Example: $ESPMAKE_PRJ_HOME/build/espinit
8585

8686
_ESPMAKE_LAST_BUILD() {
87-
echo "${ESPMAKE_PRJ_HOME}/$(CH_BUILD)/$(basename $(dirname $(cat $ESPMAKE_PRJ_LAST)))_$(basename $(cat $ESPMAKE_PRJ_LAST) .mk)"
87+
echo "${ESPMAKE_PRJ_HOME}/$CH_BUILD/$(basename $(dirname $(cat $ESPMAKE_PRJ_LAST)))_$(basename $(cat $ESPMAKE_PRJ_LAST) .mk)"
8888
}
8989

9090
# Helper function that returns the name of the esphome device as
@@ -103,12 +103,12 @@ alias _ESPMAKE_USB='function _ESPMAKE_USB { _VERB=${1}; _DEV=${2}; cd $(_ESPMAKE
103103
# Helper alias to upload last project using OTA update to IP _ESPMAKE_IP<arg>
104104
# Note the indirect variable reference ${!_IP} to choose the _IP
105105

106-
alias _ESPMAKE_UPLOAD='function _ESPMAKE_UPLOAD { _IPNUM=${1}; _IP=_ESPMAKE_IP${_IPNUM}; esphome -v upload --device ${!_IP} --file $(_ESPMAKE_LAST_BUILD)/.esphome/$(CH_BUILD)/$(_ESPMAKE_LAST_ESPNAME)/.pioenvs/$(_ESPMAKE_LAST_ESPNAME)/firmware.bin $(_ESPMAKE_LAST_BUILD)/espmake.yaml;}; _ESPMAKE_UPLOAD'
106+
alias _ESPMAKE_UPLOAD='function _ESPMAKE_UPLOAD { _IPNUM=${1}; _IP=_ESPMAKE_IP${_IPNUM}; esphome -v upload --device ${!_IP} --file $(_ESPMAKE_LAST_BUILD)/.esphome/$CH_BUILD/$(_ESPMAKE_LAST_ESPNAME)/.pioenvs/$(_ESPMAKE_LAST_ESPNAME)/firmware.bin $(_ESPMAKE_LAST_BUILD)/espmake.yaml;}; _ESPMAKE_UPLOAD'
107107

108108
# _ESPMAKE_IDF_JTAG uses esp-idf directly to burn firmware to /dev/ttyACM0
109109

110110
export ESPTOOL_TESTING=1 # as per esptool/esp32s2.py
111-
alias _ESPMAKE_IDF_JTAG='(cd $(_ESPMAKE_LAST_BUILD)/.esphome/$(CH_BUILD)/$(_ESPMAKE_LAST_ESPNAME)/.pioenvs/$(_ESPMAKE_LAST_ESPNAME) && esptool.py --before default_reset --after no_reset --baud 1500000 --port $_ESPMAKE_DEV0 --chip esp32s2 write_flash -z --flash_size detect 0x10000 firmware.bin 0x1000 bootloader.bin 0x8000 partitions.bin 0x9000 ota_data_initial.bin)'
111+
alias _ESPMAKE_IDF_JTAG='(cd $(_ESPMAKE_LAST_BUILD)/.esphome/$CH_BUILD/$(_ESPMAKE_LAST_ESPNAME)/.pioenvs/$(_ESPMAKE_LAST_ESPNAME) && esptool.py --before default_reset --after no_reset --baud 1500000 --port $_ESPMAKE_DEV0 --chip esp32s2 write_flash -z --flash_size detect 0x10000 firmware.bin 0x1000 bootloader.bin 0x8000 partitions.bin 0x9000 ota_data_initial.bin)'
112112

113113
# Convenience aliases
114114

@@ -157,7 +157,7 @@ alias ${ESPMAKE_PREFIX}esphome='view $(_ESPMAKE_LAST_BUILD)/esphome.yaml'
157157
# Aliases to find strings including or excluding the build directory
158158

159159
alias ${ESPMAKE_PREFIX}search="find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' -type f -print0 | xargs -0 grep -i"
160-
alias ${ESPMAKE_PREFIX}search_home="find $ESPMAKE_PRJ_HOME ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path '*/$(CH_BUILD)/*' ! -path '*/cpphash/*' -type f -print0 | xargs -0 grep -i"
160+
alias ${ESPMAKE_PREFIX}search_home="find $ESPMAKE_PRJ_HOME ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path "*/$CH_BUILD/*" ! -path './cpphash/*' -type f -print0 | xargs -0 grep -i"
161161
alias ${ESPMAKE_PREFIX}search_all="find $ESPMAKE_PRJ_HOME ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' -type f -print0 | xargs -0 grep -i"
162162

163163
# Aliases to search for arg1 and replace it with arg2 in all files.
@@ -166,13 +166,13 @@ alias ${ESPMAKE_PREFIX}search_all="find $ESPMAKE_PRJ_HOME ! -name '*.swp' ! -nam
166166
# bash does not seem to allow these to be defined with ESPMAKE_PREFIX.
167167

168168
esp_replace_nohash() {
169-
find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path '*/$(CH_BUILD)/*' ! -path '*/cpphash/*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s#$1#$2#g"
169+
find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path "*/$CH_BUILD/*" ! -path './cpphash/*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s#$1#$2#g"
170170
}
171171
esp_replace_nocomma() {
172-
find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path '*/$(CH_BUILD)/*' ! -path '*/cpphash/*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s,$1,$2,g"
172+
find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path "*/$CH_BUILD/*" ! -path './cpphash/*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s,$1,$2,g"
173173
}
174174
esp_replace_noslash() {
175-
find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path '*/$(CH_BUILD)/*' ! -path '*/cpphash*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s/$1/$2/g"
175+
find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path "*/$CH_BUILD/*" ! -path './cpphash*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s/$1/$2/g"
176176
}
177177
alias esp_replace="esp_replace_noslash"
178178

espmerge.sh renamed to idmerge.sh

File renamed without changes.

0 commit comments

Comments
 (0)