Skip to content

Commit

Permalink
fix: deprecate direnv integration
Browse files Browse the repository at this point in the history
Fixes #2362
  • Loading branch information
jdx committed Dec 11, 2024
1 parent c5e49fa commit c64d273
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 24 deletions.
4 changes: 2 additions & 2 deletions docs/.vitepress/cli_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const commands: { [key: string]: Command } = {
hide: false,
},
direnv: {
hide: false,
hide: true,
subcommands: {
envrc: {
hide: true,
Expand All @@ -89,7 +89,7 @@ export const commands: { [key: string]: Command } = {
hide: true,
},
activate: {
hide: false,
hide: true,
},
},
},
Expand Down
2 changes: 0 additions & 2 deletions docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ Answer yes to all confirmation prompts
- [`mise config ls [--no-header] [-J --json]`](/cli/config/ls.md)
- [`mise config set [-f --file <FILE>] [-t --type <TYPE>] <KEY> <VALUE>`](/cli/config/set.md)
- [`mise deactivate`](/cli/deactivate.md)
- [`mise direnv <SUBCOMMAND>`](/cli/direnv.md)
- [`mise direnv activate`](/cli/direnv/activate.md)
- [`mise doctor`](/cli/doctor.md)
- [`mise en [-s --shell <SHELL>] [DIR]`](/cli/en.md)
- [`mise env [FLAGS] [TOOL@VERSION]...`](/cli/env.md)
Expand Down
4 changes: 3 additions & 1 deletion docs/direnv.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# direnv
# direnv <Badge type="warning" text="deprecated" />

[direnv](https://direnv.net) and mise both manage environment variables based on directory. Because
they both analyze
the current environment variables before and after their respective "hook" commands are run, they
can sometimes conflict with each other.

::: warning
The official stance is you should not use direnv with mise. Issues arising
from incompatibilities are not considered bugs. If mise has feature gaps
that direnv resolves, please open an issue so we can close those gaps.
While that's the official stance, the reality is mise and direnv usually
will work together just fine despite this. It's only more advanced use-cases
where problems arise.
:::

If you have an issue, it's likely to do with the ordering of PATH. This means it would
really only be a problem if you were trying to manage the same tool with direnv and mise. For
Expand Down
3 changes: 0 additions & 3 deletions man/man1/mise.1
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ Manage config files
mise\-deactivate(1)
Disable mise for current shell session
.TP
mise\-direnv(1)
Output direnv function to use mise inside direnv
.TP
mise\-doctor(1)
Check mise installation for possible problems
.TP
Expand Down
4 changes: 2 additions & 2 deletions mise.usage.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ This can be used to temporarily disable mise in a shell session."
$ mise deactivate
"
}
cmd "direnv" help="Output direnv function to use mise inside direnv" {
cmd "direnv" hide=true help="Output direnv function to use mise inside direnv" {
long_help r"Output direnv function to use mise inside direnv

See https://mise.jdx.dev/direnv.html for more information
Expand All @@ -321,7 +321,7 @@ you should run this command after installing new plugins. Otherwise
direnv may not know to update environment variables when idiomatic file versions change."
cmd "envrc" hide=true help="[internal] This is an internal command that writes an envrc file\nfor direnv to consume."
cmd "exec" hide=true help="[internal] This is an internal command that writes an envrc file\nfor direnv to consume."
cmd "activate" help="Output direnv function to use mise inside direnv" {
cmd "activate" hide=true help="Output direnv function to use mise inside direnv" {
long_help r"Output direnv function to use mise inside direnv

See https://mise.jdx.dev/direnv.html for more information
Expand Down
14 changes: 0 additions & 14 deletions xtasks/fig/src/mise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -822,20 +822,6 @@ const completionSpec: Fig.Spec = {
],
"description": "Disable mise for current shell session"
},
{
"name": [
"direnv"
],
"description": "Output direnv function to use mise inside direnv",
"subcommands": [
{
"name": [
"activate"
],
"description": "Output direnv function to use mise inside direnv"
}
]
},
{
"name": [
"doctor",
Expand Down

0 comments on commit c64d273

Please sign in to comment.