Skip to content

fix: Fix config path handling#161

Merged
guyfedwards merged 1 commit intoguyfedwards:masterfrom
larsks:fix/config-path
Oct 2, 2025
Merged

fix: Fix config path handling#161
guyfedwards merged 1 commit intoguyfedwards:masterfrom
larsks:fix/config-path

Conversation

@larsks
Copy link
Copy Markdown
Contributor

@larsks larsks commented Oct 2, 2025

The config handling code was erroneously including the path separator in arguments to filepath.Join, like this:

configFile := filepath.Join(configDir, "/config.yml")

When running nom against a config file in the current directory:

nom --config-path config.yml

This would result in configDir equal to "", and configFile would get set to /config.yml. This commit updates the path handling code to correctly use filepath.Join. It also replaces string splitting on paths with filepath.Split.

We also add a -c short option for setting the configuration path:

nom -c config.yml

The config handling code was erroneously including the path separator in
arguments to `filepath.Join`, like this:

    configFile := filepath.Join(configDir, "/config.yml")

When running nom against a config file in the current directory:

    nom --config-path config.yml

This would result in `configDir` equal to `""`, and `configFile` would get
set to `/config.yml`. This commit updates the path handling code to
correctly use `filepath.Join`. It also replaces string splitting on paths
with `filepath.Split`.

We also add a `-c` short option for setting the configuration path:

    nom -c config.yml
@guyfedwards guyfedwards merged commit ae96e1d into guyfedwards:master Oct 2, 2025
2 checks passed
@guyfedwards
Copy link
Copy Markdown
Owner

Thanks @larsks

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