julep
julep copied to clipboard
#313 Update generate_openapi_code.sh
The script has been enhanced by organizing the tasks into functions for improved readability and modularity. A logging system was introduced to capture and store actions in both the console and a log file for better traceability. Error handling was added to ensure that any failures are caught with custom error messages, improving the robustness of the script. Additionally, an optional feature allows updating Poetry dependencies via a command-line flag, adding flexibility. The script now tracks the total execution time, providing insights into performance. Overall, the improvements make the script more structured, flexible, and user-friendly.
[!IMPORTANT] Refactor
generate_openapi_code.shto improve modularity, add logging, error handling, and optional Poetry updates.
- Modularity:
- Refactor script into functions:
log_action(),compile_typespec(),run_poetry_tasks(), andusage().- Logging:
- Introduce
log_action()to log actions to console andscript.log.- Log start and end of script execution with timestamps.
- Error Handling:
- Add error handling with custom messages in
compile_typespec()andrun_poetry_tasks().- Features:
- Add command-line flag
--update-poetryto optionally update Poetry dependencies.- Track and log total execution time.
- Misc:
- Update script usage instructions in
usage().This description was created by
for 9f5d9c841b804c7a7021b48a65a8ecfee7cd61c8. It will automatically update as commits are pushed.