Skip to content

fix: return an error when the home directory cannot be determined - #584

Open
Sarthak-Shreshtha01 wants to merge 1 commit into
microcks:masterfrom
Sarthak-Shreshtha01:fix/issue-583
Open

Sarthak-Shreshtha01 wants to merge 1 commit into
microcks:masterfrom
Sarthak-Shreshtha01:fix/issue-583

Conversation

@Sarthak-Shreshtha01

Copy link
Copy Markdown

DefaultConfigDir now returns an error when the home directory cannot be found and MICROCKS_CONFIG_DIR is not set, instead of an empty path that made the config file resolve to the current directory. The related tests pass, including the new TestDefaultPathsWithoutHomeDir.

Fixes #583

Signed-off-by: Sarthak <sarthakshreshtha345@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@SafeeImran

Copy link
Copy Markdown

@Sarthak-Shreshtha01

could we resolve the default config path after Cobra parses flags? As written, if home-directory resolution fails while NewCommand() is being built, an explicit --config override may not get a chance to work. Returning a clear error is still a good fallback when no override is supplied.

This branch has not been deployed

No deployments
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.

Default configuration path falls back to the current directory when the home directory cannot be determined

3 participants