Conversation
…/Arduino/hardware/espressif/esp32/
|
Probably need to delete any example specific boards.local.txt and revert to the root one after each example runs / is tested. |
brentru
left a comment
There was a problem hiding this comment.
Tyeth and I went over this over slack, all changes OK 🏁
| """ | ||
| try: | ||
| local_app_data_dir = os.environ.get('HOME', '') | ||
| data_dir = None |
There was a problem hiding this comment.
place local_app_data_dir and data_dir above the try, it's referenced lower in the code too. If it fails, you dont have a reference to these when you need data_dir again on L479
There was a problem hiding this comment.
I don't believe this makes sense (with regards to line 479 of original review), as the try covers the entire function so the variables won't be reused in the event of a caught error, can you explain it to me?
| if sys.argv[sys.argv.index("--boards-local-txt") + 1].startswith("--"): | ||
| if os.path.exists("boards.local.txt"): | ||
| boards_local_txt = "boards.local.txt" | ||
| else: | ||
| sys.stderr.write("Error: --boards-local-txt option requires a path to boards.local.txt file (or to be present in current directory)\n") | ||
| sys.exit(1) | ||
| # get the boards.local.txt file from the command line (index exists checked earlier) | ||
| if not os.path.exists(sys.argv[sys.argv.index("--boards-local-txt") + 1]): | ||
| sys.stderr.write("Error: boards.local.txt file does not exist\n") | ||
| sys.exit(1) | ||
| boards_local_txt = sys.argv[sys.argv.index("--boards-local-txt") + 1] |
There was a problem hiding this comment.
second if should be elif but negated with the line57 body, and first if should confirm there is a period (".") in the argument that follows --boards-local-txt, and finally the error as else body.
|
Annoyingly when testing in a private repo to show the different architectures worked similarly I found that the defines were'n't reliably being pulled through for all arches+targets, so have this on hold while I do a bit more testing / fixing |
Adds support for
--boards-local-txtargument, with file specified or defaulting to current working directory.Copies specified file, if found, to the board support package for the platform.
Flag also enables support for
boards.txt.localfile in example/sketch folders, and/or board build target specific.<platform>.boards.local.txtin example folders