Skip to content

Commit

Permalink
feat: added special "_" portion of mise.toml for custom data (#3259)
Browse files Browse the repository at this point in the history
Fixes #2342
  • Loading branch information
jdx authored Nov 28, 2024
1 parent fe50c72 commit 46e9b8a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ experimental = true # enable experimental features

# configure messages displayed when entering directories with config files
status = { missing_tools = "if_other_versions_installed", show_env = false, show_tools = false }

# "_" is a special key for information you'd like to put into mise.toml that mise will never parse
[_]
foo = "bar"
```

## System config: `/etc/mise/config.toml`
Expand Down
3 changes: 3 additions & 0 deletions schema/mise.json
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,9 @@
},
"description": "dev tools to use",
"type": "object"
},
"_": {
"additionalProperties": true
}
}
}
3 changes: 3 additions & 0 deletions src/config/config_file/mise_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ use crate::{dirs, file};

#[derive(Default, Deserialize)]
pub struct MiseToml {
#[serde(rename = "_")]
custom: Option<toml::Value>,
#[serde(default, deserialize_with = "deserialize_version")]
min_version: Option<Versioning>,
#[serde(skip)]
Expand Down Expand Up @@ -482,6 +484,7 @@ impl Debug for MiseToml {
impl Clone for MiseToml {
fn clone(&self) -> Self {
Self {
custom: self.custom.clone(),
min_version: self.min_version.clone(),
context: self.context.clone(),
path: self.path.clone(),
Expand Down

0 comments on commit 46e9b8a

Please sign in to comment.