Skip to content
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

warn_timeout setting is ignored #578

Open
jason0x43 opened this issue Feb 1, 2020 · 2 comments
Open

warn_timeout setting is ignored #578

jason0x43 opened this issue Feb 1, 2020 · 2 comments
Labels
Bug

Comments

@jason0x43
Copy link

@jason0x43 jason0x43 commented Feb 1, 2020

Describe the bug

This could just be a usage error on my part, but the documentation about warn_timeout is a bit confusing. In any case, I have installed direnv via asdf's direnv plugin. I have a $HOME/.config/direnv directory containing direnvrc and direnv.toml.

❯ ls $HOME/.config/direnv/
direnv.toml  direnvrc

My toml file contains one entry:

❯ cat $HOME/.config/direnv/direnv.toml
warn_timeout = "30s"

When I run direnv status, direnv can see my config directory, but it's not picking up the warn_timeout setting.

❯ direnv status
direnv exec path /Users/jason/.asdf/installs/direnv/2.21.2/bin/direnv
DIRENV_CONFIG /Users/jason/.config/direnv
bash_path /usr/local/bin/bash
disable_stdin false
warn_timeout 5s
whitelist.prefix []
whitelist.exact map[]

To Reproduce

  1. Install direnv 2.21.2
  2. Create $HOME/.config/direnv/direnv.toml with a warn_timeout = "30s" entry.
  3. Run direnv status, noting that the warn_timeout value is not "30s"

Expected behavior

direnv should be using the warn_timeout value I set.

Environment

  • OS: macOS Catalina
  • Shell: zsh
  • Direnv version 2.21.2

Additional context

@jason0x43 jason0x43 added the Bug label Feb 1, 2020
@jason0x43
Copy link
Author

@jason0x43 jason0x43 commented Feb 1, 2020

The problem mentioned here was also confusing to me. From the followup comment I think my toml file is setup correctly, but maybe not?

zimbatm added a commit to zimbatm/direnv that referenced this issue Feb 5, 2020
TOML will look at the underlying representation and find the integer,
then try to parse an integer instead of the time.Duration.

Fixes direnv#578
@zimbatm
Copy link
Member

@zimbatm zimbatm commented Feb 5, 2020

Thanks for the report. That config parsing really needs more testing.

  • e9bca3d which is in master fixed the config file selection
  • the PR ^^ fixes the actual parsing of the option
  • TODO: add a [global] section
zimbatm added a commit to zimbatm/direnv that referenced this issue Feb 5, 2020
TOML will look at the underlying representation and find the integer,
then try to parse an integer instead of the time.Duration.

Related direnv#578
zimbatm added a commit that referenced this issue Feb 5, 2020
TOML will look at the underlying representation and find the integer,
then try to parse an integer instead of the time.Duration.

Related #578
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.