Skip to content

Conversation

@manusa
Copy link
Owner

@manusa manusa commented Oct 3, 2025

Relates to #363

@manusa manusa requested a review from Copilot October 3, 2025 18:04
Copy link
Contributor

Copilot AI left a 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 setSettingsPath function to dynamically update the settings file location
  • Implemented command-line argument parsing to accept --settings-path parameter
  • 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]) {
Copy link

Copilot AI Oct 3, 2025

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.

Suggested change
if (settingsPathIndex !== -1 && args[settingsPathIndex + 1]) {
if (
settingsPathIndex !== -1 &&
args[settingsPathIndex + 1] &&
!args[settingsPathIndex + 1].startsWith('--')
) {

Copilot uses AI. Check for mistakes.
@manusa manusa added this to the 0.1.0 milestone Oct 3, 2025
@manusa manusa force-pushed the feat/settings-flag branch from 8d4c9f0 to 830bd1c Compare October 3, 2025 18:17
@manusa manusa requested a review from Copilot October 3, 2025 18:18
Copy link
Contributor

Copilot AI left a 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>
@manusa manusa force-pushed the feat/settings-flag branch from 830bd1c to f59a73e Compare October 3, 2025 18:26
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 3, 2025

@manusa manusa merged commit 8c96a16 into main Oct 3, 2025
6 checks passed
@manusa manusa deleted the feat/settings-flag branch October 3, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants