Add --vmargs-path option to support custom vm.args file paths
This PR adds a new --vmargs-path option to erlinit that allows users to specify a custom path to the vm.args file. This complements the existing --boot option and provides flexibility for deployments that need to use vm.args files in non-standard locations.
Changes
- Added
--vmargs-pathcommand-line option that accepts a path to a vm.args file - Supports both absolute paths (e.g.,
/data/vm.args) and relative paths (e.g.,custom.vm.argsrelative to the release version directory) - If the specified file exists, erlinit uses it
- If the specified file doesn't exist, erlinit prints a warning and falls back to the default
vm.argslocation in the release version directory
Implementation
The implementation follows the same pattern as the existing --boot option for consistency:
- Check if user specified a custom vmargs path
- Resolve absolute vs relative paths
- Verify the file exists
- Fall back to default location if not found, with a warning
Example Usage
In erlinit.config:
--vmargs-path
/data/custom.vm.args
Or on the command line:
erlinit --vmargs-path custom.vm.args
Testing
Added three comprehensive test cases:
-
068_vmargs_path: Verifies a valid custom vm.args path (relative) works correctly -
069_vmargs_path_missing: Verifies fallback behavior when specified file doesn't exist -
070_vmargs_path_absolute: Verifies absolute path support
All 70 tests pass successfully.
Fixes #[issue_number]
Original prompt
This section details on the original issue you should resolve
<issue_title>Add an erlinit.conf option to support passing a path for the vm.args</issue_title> <issue_description>When the option is passed, erlinit should check that the file exists. If it does, it should use it. If it doesn't, it should print a warning and find the OTP release's vm.args instead.</issue_description>
Comments on the Issue (you are @copilot in this section)
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.