-
-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* lazy-load toml_edit * Commit from GitHub Actions (test) --------- Co-authored-by: mise[bot] <[email protected]>
- Loading branch information
1 parent
0eae892
commit ae658f8
Showing
17 changed files
with
190 additions
and
102 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
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 |
---|---|---|
|
@@ -122,14 +122,14 @@ impl Use { | |
} | ||
}) | ||
.collect(); | ||
cf.replace_versions(fa, &versions); | ||
cf.replace_versions(fa, &versions)?; | ||
} | ||
|
||
if self.global { | ||
self.warn_if_hidden(&config, cf.get_path()); | ||
} | ||
for plugin_name in &self.remove { | ||
cf.remove_plugin(plugin_name); | ||
cf.remove_plugin(plugin_name)?; | ||
} | ||
cf.save()?; | ||
self.render_success_message(cf.as_ref(), &versions); | ||
|
@@ -264,13 +264,31 @@ mod tests { | |
fn test_use_global() { | ||
let cf_path = dirs::CONFIG.join("config.toml"); | ||
let orig = file::read_to_string(&cf_path).unwrap(); | ||
let _ = file::remove_file(&cf_path); | ||
|
||
assert_cli_snapshot!("use", "-g", "tiny@2", @r###" | ||
mise ~/config/config.toml tools: [email protected] | ||
mise tiny is defined in ~/cwd/.test-tool-versions which overrides the global config (~/config/config.toml) | ||
"###); | ||
assert_snapshot!(file::read_to_string(&cf_path).unwrap(), @r###" | ||
[env] | ||
TEST_ENV_VAR = 'test-123' | ||
[alias.tiny] | ||
"my/alias" = '3.0' | ||
[tasks.configtask] | ||
run = 'echo "configtask:"' | ||
[tasks.lint] | ||
run = 'echo "linting!"' | ||
[tasks.test] | ||
run = 'echo "testing!"' | ||
[settings] | ||
always_keep_download= true | ||
always_keep_install= true | ||
legacy_version_file= true | ||
plugin_autoupdate_last_check_duration = "20m" | ||
jobs = 2 | ||
[tools] | ||
tiny = "2" | ||
"###); | ||
|
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
Oops, something went wrong.