Commit 4ad90ba
Fix prepare-firmware.sh - redirect debug output to stderr
Fixed error where debug output was being passed as filename to esptool.py:
**Problem:** The find_file function echoed debug messages to stdout, which
were then captured by command substitution and passed as arguments to
esptool.py, causing "No such file or directory" errors with the debug text
as the filename.
**Root Cause:** In bash, command substitution $(command) captures ALL output
from the command, not just the intended return value. The function was
echoing both debug messages and the file path to stdout.
**Fix:**
- Redirect all debug output to stderr using >&2
- Only the actual file path goes to stdout
- Command substitution now captures just the file path
- Debug output is still visible to user but doesn't interfere with logic
The script will now correctly pass file paths to esptool.py while still
showing helpful debug information.
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>1 parent cbd726f commit 4ad90ba
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
0 commit comments