Command Handlers
Command Line parsing is handled by the commander library.
Design Philosophy
The command handlers are kept in a separate folder from the builders. This allows us to test the command handlers separately from the builders by mocking the builder implementations.
Command execution follows the following steps:
- Command arguments from the user are parsed
- The arguments are parsed to the corresponding builder
- The builder returns a result object, which is formatted into a string
- The formatted result is printed to the terminal
process.exitis called with a non zero exit code if there were any errors present
CI Pipeline Compatibility
Since the buildtools need to be run as part of the CI pipeline, it is important that they return non-zero exit codes when appropriate so that the CI pipeline can detect that errors have occurred and halt the pipeline.
Command Execution Flow
Single Bundle/Tab
For a command that processes a single bundle or tab, this is the flow of the command: