-
Notifications
You must be signed in to change notification settings - Fork 37
feat(settings): settings path can be set through command-line #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the ability to specify a custom settings file path through a command-line argument --settings-path. This enables users to use multiple profiles or custom configurations by pointing to different settings files.
- Added
setSettingsPathfunction to dynamically update the settings file location - Implemented command-line argument parsing to accept
--settings-pathparameter - Updated test utilities to use the new settings path API instead of direct path manipulation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/settings/index.js | Added setSettingsPath function and exported it; removed internal paths export |
| src/settings/tests/index.test.js | Added comprehensive tests for the new setSettingsPath functionality |
| src/index.js | Added command-line argument parsing to support --settings-path option |
| src/tests/settings.js | Updated test setup to use setSettingsPath instead of direct path manipulation |
src/index.js
Outdated
| // Parse command line arguments for custom settings path | ||
| const args = process.argv.slice(process.defaultApp ? 2 : 1); | ||
| const settingsPathIndex = args.indexOf('--settings-path'); | ||
| if (settingsPathIndex !== -1 && args[settingsPathIndex + 1]) { |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command-line argument parsing lacks validation. If the argument after --settings-path is another flag (starts with '--'), it will be incorrectly treated as a file path. Consider adding validation to ensure the argument is a valid path.
| if (settingsPathIndex !== -1 && args[settingsPathIndex + 1]) { | |
| if ( | |
| settingsPathIndex !== -1 && | |
| args[settingsPathIndex + 1] && | |
| !args[settingsPathIndex + 1].startsWith('--') | |
| ) { |
8d4c9f0 to
830bd1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Signed-off-by: Marc Nuri <marc@marcnuri.com>
830bd1c to
f59a73e
Compare
|



Relates to #363