-
-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added .tool-versions -> mise.toml converter (#3693)
Fixes #970
- Loading branch information
Showing
13 changed files
with
166 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# `mise generate config` | ||
|
||
- **Usage**: `mise generate config [-t --tool-versions <TOOL_VERSIONS>] [-o --output <OUTPUT>]` | ||
- **Aliases**: `g` | ||
- **Source code**: [`src/cli/generate/config.rs`](https://github.com/jdx/mise/blob/main/src/cli/generate/config.rs) | ||
|
||
[experimental] Generate a mise.toml file | ||
|
||
## Flags | ||
|
||
### `-t --tool-versions <TOOL_VERSIONS>` | ||
|
||
Path to a .tool-versions file to import tools from | ||
|
||
### `-o --output <OUTPUT>` | ||
|
||
Output to file instead of stdout | ||
|
||
Examples: | ||
|
||
``` | ||
mise cf generate > mise.toml | ||
mise cf generate --output=mise.toml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
cat <<EOF >.tool-versions | ||
node 22 | ||
python 3.9 3.10 3.11 | ||
EOF | ||
|
||
assert "mise generate config --tool-versions .tool-versions" '[tools] | ||
node = "22" | ||
python = ["3.9", "3.10", "3.11"]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use clap::Subcommand; | ||
use eyre::Result; | ||
mod generate; | ||
pub(crate) mod generate; | ||
mod get; | ||
mod ls; | ||
mod set; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use crate::cli::config::generate; | ||
use crate::Result; | ||
|
||
/// [experimental] Generate a mise.toml file | ||
#[derive(Debug, clap::Args)] | ||
#[clap(verbatim_doc_comment, after_long_help = generate::AFTER_LONG_HELP)] | ||
pub struct Config { | ||
#[clap(flatten)] | ||
generate: generate::ConfigGenerate, | ||
} | ||
|
||
impl Config { | ||
pub fn run(self) -> Result<()> { | ||
self.generate.run() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters