Adding build-type commands in build_native.sh#34
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new commands build type to build_native.sh, allowing users to specify arbitrary build commands in a JSON config file, and makes library installation skip gracefully when no library output path is configured.
Changes:
- New
build_component_commands()function that reads and executes build commands from the JSON config - Skip library installation when
LIB_PATHis not set or is"null" - Wire up the
commandsbuild type in themain()case statement
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| command=$(expand_path "$command") | ||
|
|
||
| log " [$((i+1))/$cmd_count] Executing: $command" | ||
| if eval "$command"; then |
There was a problem hiding this comment.
Using eval on commands read from a JSON config file is a security risk if the config file could be tampered with or contain unexpected content. Consider whether you could use bash -c "$command" or even direct execution without eval. If the commands don't require shell features like pipes or redirects, you could use an array-based approach to avoid shell injection. If eval is intentional to support full shell syntax, this should at least be documented as a security consideration.
| if eval "$command"; then | |
| if bash -c "$command"; then |
Adding build-type commands in build_native.sh