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

Setting environment variables not working as expected #1613

Closed
fabge opened this issue Feb 5, 2024 · 3 comments · Fixed by #1615
Closed

Setting environment variables not working as expected #1613

fabge opened this issue Feb 5, 2024 · 3 comments · Fixed by #1615
Labels
bug Something isn't working

Comments

@fabge
Copy link

fabge commented Feb 5, 2024

I want to set environment variables by leveraging .env files in folders. I have set export MISE_ENV_FILE=.env in my .zshrc.
mise does recognize values inside the .env files but doesn't set them as environment variables.

I have a .env file in the directory debug with following content:

HELLO=world

I can observe the following:

cd debug
echo $HELLO
# No Output
mise env
# export HELLO=world
# export PATH='...

I am unsure if I am misunderstanding how this is supposed to work. I was expecting the environment variable HELLO to be set, when cding in to a folder which contains a .env file.

mise doctor output

mise version:
  2024.2.4 macos-arm64 (2024-02-03)

build:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Sat, 3 Feb 2024 03:13:22 +0000
  Rust Version: rustc 1.75.0 (82e1608df 2023-12-21) (Homebrew)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin23.0)

mise data directory:
  /Users/fabian/.local/share/mise

mise environment variables:
  MISE_ENV_FILE=.env
  MISE_SHELL=zsh

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_tools = []
  experimental = false
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  plugin_autoupdate_last_check_duration = "7d"
  python_compile = false
  python_default_packages_file = "/Users/fabian/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  python_venv_auto_create = false
  raw = false
  trusted_config_paths = []
  quiet = false
  verbose = false
  yes = false
  ci = false
  debug = false
  env_file = ".env"
  trace = false
  log_level = "info"

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false


config files:
  ~/.config/mise/config.toml

plugins:
  bun      (core)
  deno     (core)
  go       (core)
  java     (core)
  node     (core)
  python   (core)
  ruby     (core)

toolset:
  python@3.12, node@20
@fabge fabge added the bug Something isn't working label Feb 5, 2024
@jdx
Copy link
Owner

jdx commented Feb 5, 2024

are you using shims?

@fabge
Copy link
Author

fabge commented Feb 5, 2024

no, but i omitted the following error from posting, when running brew doctor:

1 problem found:
shims are missing, run mise reshim to create them
Missing shims: ghpath, rst2html4.py, mid3iconv, gh-create-workflow, jp.py, rst2html.py, uvicorn, rst2html5.py, unidecode, rstpep2html.py, pelican-plugins, mid3cp, rst2latex.py, markdown-it, markdown_py, zspotify, docutils, django-admin, f2py, pelican-themes, rst2xml.py, rst2man.py, mutagen-inspect, ghapi, pelican-import, moggsplit, mutagen-pony, pygmentize, mid3v2, rst2pseudoxml.py, rst2odt.py, rst2s5.py, ghraw, watchfiles, normalizer, tqdm, completion-ghapi, pelican, wsdump, pelican-quickstart, sqlformat, rst2xetex.py, rst2odt_prepstyles.py

jdx added a commit that referenced this issue Feb 5, 2024
jdx added a commit that referenced this issue Feb 5, 2024
@jdx jdx closed this as completed in #1615 Feb 5, 2024
jdx added a commit that referenced this issue Feb 5, 2024
@fabge
Copy link
Author

fabge commented Feb 9, 2024

thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants